summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/api-error-response.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-06-26 20:45:49 +0000
committerLibravatar GitHub <noreply@github.com>2023-06-26 20:45:49 +0000
commite3e0f673ccc1bb862a5c0eaa537a5cf37aeb2b88 (patch)
tree1e361710c67c8c8104dfc6e1774339c144d20335 /vendor/github.com/minio/minio-go/v7/api-error-response.go
parent[chore]: Bump github.com/miekg/dns from 1.1.54 to 1.1.55 (#1929) (diff)
downloadgotosocial-e3e0f673ccc1bb862a5c0eaa537a5cf37aeb2b88.tar.xz
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.56 to 7.0.58 (#1928)
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api-error-response.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/api-error-response.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api-error-response.go b/vendor/github.com/minio/minio-go/v7/api-error-response.go
index 4ec0c87c2..7df211fda 100644
--- a/vendor/github.com/minio/minio-go/v7/api-error-response.go
+++ b/vendor/github.com/minio/minio-go/v7/api-error-response.go
@@ -23,6 +23,7 @@ import (
"fmt"
"io"
"net/http"
+ "strings"
)
/* **** SAMPLE ERROR RESPONSE ****
@@ -188,6 +189,15 @@ func httpRespToErrorResponse(resp *http.Response, bucketName, objectName string)
}
}
+ code := resp.Header.Get("x-minio-error-code")
+ if code != "" {
+ errResp.Code = code
+ }
+ desc := resp.Header.Get("x-minio-error-desc")
+ if desc != "" {
+ errResp.Message = strings.Trim(desc, `"`)
+ }
+
// Save hostID, requestID and region information
// from headers if not available through error XML.
if errResp.RequestID == "" {