From 8c97a853d8c7ca5887345639f7f50481c529ca10 Mon Sep 17 00:00:00 2001 From: "weiyuan.yl" Date: Thu, 24 Dec 2015 21:02:35 +0800 Subject: [PATCH] Update OSS client for more details in the error message Change-Id: Ie2aa70dfeb69930ee5eda17d7e744e3f95a8b926 Signed-off-by: weiyuan.yl --- Godeps/Godeps.json | 6 +++--- .../src/github.com/denverdino/aliyungo/common/request.go | 2 +- .../src/github.com/denverdino/aliyungo/oss/client.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index d4d962319..18180076e 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -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", diff --git a/Godeps/_workspace/src/github.com/denverdino/aliyungo/common/request.go b/Godeps/_workspace/src/github.com/denverdino/aliyungo/common/request.go index 5f7f15afd..2a883f19b 100644 --- a/Godeps/_workspace/src/github.com/denverdino/aliyungo/common/request.go +++ b/Godeps/_workspace/src/github.com/denverdino/aliyungo/common/request.go @@ -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 diff --git a/Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/client.go b/Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/client.go index 7a901ba98..ac3e8f029 100644 --- a/Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/client.go +++ b/Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/client.go @@ -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 {