summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-storage/s3/errors.go
blob: 1f44044694e13b9701700ba97e2b5b51aa53d9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package s3

import (
	"strings"

	"github.com/minio/minio-go/v7"
)

func isNotFoundError(err error) bool {
	errRsp, ok := err.(minio.ErrorResponse)
	return ok && errRsp.Code == "NoSuchKey"
}

func isConflictError(err error) bool {
	errRsp, ok := err.(minio.ErrorResponse)
	return ok && errRsp.Code == "Conflict"
}

func isObjectNameError(err error) bool {
	return strings.HasPrefix(err.Error(), "Object name ")
}