diff options
| author | Marin Ivanov <[email protected]> | 2022-08-15 05:15:14 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2022-08-15 05:15:14 +0300 |
| commit | 28224be36da864bfca19e30de920dbd195d7ef5b (patch) | |
| tree | 158be382a95ef159d2b644a3600cf4d60460bbda /errors.go | |
| parent | 43069c737dde59bd86e5b09c496d9df90f29d136 (diff) | |
Rename transform* => from*
Diffstat (limited to 'errors.go')
| -rw-r--r-- | errors.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..5c1802e --- /dev/null +++ b/errors.go @@ -0,0 +1,22 @@ +package s3 + +import ( + "github.com/minio/minio-go/v7" + "github.com/spf13/afero" +) + +func fromErrorResponse(err error) error { + resp, ok := err.(minio.ErrorResponse) + if !ok { + return err + } + + switch resp.Code { + case "NoSuchKey": + return afero.ErrFileNotFound + case "EntityTooLarge": + return afero.ErrTooLarge + } + + return err +} |
