summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-storage/s3/errors.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-09-26 12:43:10 +0000
committerLibravatar GitHub <noreply@github.com>2024-09-26 14:43:10 +0200
commit53ee6aef0885b4055ef95bf4f20ee78fd381e333 (patch)
treea181b038dc969482b34690603328dd6b756a42fb /vendor/codeberg.org/gruf/go-storage/s3/errors.go
parent[chore] reduce number admin process workers (#3354) (diff)
downloadgotosocial-53ee6aef0885b4055ef95bf4f20ee78fd381e333.tar.xz
[bugfix] s3 media uploaded without content-type (#3353)
* update go-storage dependency, for S3Storage manually call PutObject() so we can set content-type * update calls to PutFile() to include the contentType
Diffstat (limited to 'vendor/codeberg.org/gruf/go-storage/s3/errors.go')
-rw-r--r--vendor/codeberg.org/gruf/go-storage/s3/errors.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/vendor/codeberg.org/gruf/go-storage/s3/errors.go b/vendor/codeberg.org/gruf/go-storage/s3/errors.go
index 2cbdd2e9d..1f4404469 100644
--- a/vendor/codeberg.org/gruf/go-storage/s3/errors.go
+++ b/vendor/codeberg.org/gruf/go-storage/s3/errors.go
@@ -3,35 +3,9 @@ package s3
import (
"strings"
- "codeberg.org/gruf/go-storage"
- "codeberg.org/gruf/go-storage/internal"
"github.com/minio/minio-go/v7"
)
-// transformS3Error transforms an error returned from S3Storage underlying
-// minio.Core client, by wrapping where necessary with our own error types.
-func transformS3Error(err error) error {
- // Cast this to a minio error response
- ersp, ok := err.(minio.ErrorResponse)
- if ok {
- switch ersp.Code {
- case "NoSuchKey":
- return internal.WrapErr(err, storage.ErrNotFound)
- case "Conflict":
- return internal.WrapErr(err, storage.ErrAlreadyExists)
- default:
- return err
- }
- }
-
- // Check if error has an invalid object name prefix
- if strings.HasPrefix(err.Error(), "Object name ") {
- return internal.WrapErr(err, storage.ErrInvalidKey)
- }
-
- return err
-}
-
func isNotFoundError(err error) bool {
errRsp, ok := err.(minio.ErrorResponse)
return ok && errRsp.Code == "NoSuchKey"