Skip to content

Commit

Permalink
handle obscure Errors properly
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbenten committed Mar 20, 2020
1 parent b7deec5 commit 8bb5094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce
github.com/urfave/cli v1.22.3
github.com/zeebo/errs v1.2.2
golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
Expand Down
3 changes: 2 additions & 1 deletion server/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/zeebo/errs"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
Expand Down Expand Up @@ -663,5 +664,5 @@ func (s *StorjStorage) Put(token string, filename string, reader io.Reader, cont
}

func (s *StorjStorage) IsNotExist(err error) bool {
return err == uplink.ErrObjectNotFound
return errs.Is(err, uplink.ErrObjectNotFound)
}

0 comments on commit 8bb5094

Please sign in to comment.