|
|
@ -18,6 +18,7 @@ import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/tools/errs"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"net/url"
|
|
|
@ -351,10 +352,7 @@ func (m *Minio) CopyObject(ctx context.Context, src string, dst string) (*s3.Cop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *Minio) IsNotFound(err error) bool {
|
|
|
|
func (m *Minio) IsNotFound(err error) bool {
|
|
|
|
if err == nil {
|
|
|
|
switch e := errs.Unwrap(err).(type) {
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch e := err.(type) {
|
|
|
|
|
|
|
|
case minio.ErrorResponse:
|
|
|
|
case minio.ErrorResponse:
|
|
|
|
return e.StatusCode == http.StatusNotFound || e.Code == "NoSuchKey"
|
|
|
|
return e.StatusCode == http.StatusNotFound || e.Code == "NoSuchKey"
|
|
|
|
case *minio.ErrorResponse:
|
|
|
|
case *minio.ErrorResponse:
|
|
|
|