Update OSS client for more details in the error message

Change-Id: Ie2aa70dfeb69930ee5eda17d7e744e3f95a8b926
Signed-off-by: weiyuan.yl <weiyuan.yl@alibaba-inc.com>
This commit is contained in:
weiyuan.yl 2015-12-24 21:02:35 +08:00
parent 54da47d636
commit 8c97a853d8
3 changed files with 5 additions and 5 deletions

6
Godeps/Godeps.json generated
View file

@ -77,15 +77,15 @@
},
{
"ImportPath": "github.com/denverdino/aliyungo/oss",
"Rev": "f192209bcca7a2221ea0b100bf4569f484654d43"
"Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502"
},
{
"ImportPath": "github.com/denverdino/aliyungo/util",
"Rev": "f192209bcca7a2221ea0b100bf4569f484654d43"
"Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502"
},
{
"ImportPath": "github.com/denverdino/aliyungo/common",
"Rev": "f192209bcca7a2221ea0b100bf4569f484654d43"
"Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502"
},
{
"ImportPath": "github.com/docker/docker/pkg/tarsum",

View file

@ -52,7 +52,7 @@ type ErrorResponse struct {
Message string
}
// An Error represents a custom error for ECS failure response
// An Error represents a custom error for Aliyun API failure response
type Error struct {
ErrorResponse
StatusCode int //Status Code of HTTP Response

View file

@ -1131,7 +1131,7 @@ type Error struct {
}
func (e *Error) Error() string {
return e.Message
return fmt.Sprintf("Aliyun API Error: RequestId: %s Status Code: %d Code: %s Message: %s", e.RequestId, e.StatusCode, e.Code, e.Message)
}
func (client *Client) buildError(r *http.Response) error {