error handling
This commit is contained in:
parent
e90852cc95
commit
a3fbd3b8e0
1 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,9 @@ func (s *Service) Upload(ctx context.Context, bucket, object string, reader io.R
|
||||||
func (s *Service) GetPublicLink(ctx context.Context, bucket, object string) (string, string, error) {
|
func (s *Service) GetPublicLink(ctx context.Context, bucket, object string) (string, string, error) {
|
||||||
stat, err := s.client.StatObject(ctx, bucket, object, minio.StatObjectOptions{})
|
stat, err := s.client.StatObject(ctx, bucket, object, minio.StatObjectOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err.Error() == minio.ToErrorResponse(err).Error() {
|
||||||
|
return "", "", nil
|
||||||
|
}
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"error": err,
|
"error": err,
|
||||||
"key": bucket + "/" + object,
|
"key": bucket + "/" + object,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue