From 8bb5094cccfd85f3d3ff492a9a55f19d70cef74a Mon Sep 17 00:00:00 2001 From: stefanbenten Date: Fri, 20 Mar 2020 13:02:27 +0100 Subject: [PATCH] handle obscure Errors properly --- go.mod | 1 + server/storage.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 58a41eb..bc4ec7e 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/server/storage.go b/server/storage.go index f3c1d79..c771257 100644 --- a/server/storage.go +++ b/server/storage.go @@ -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" @@ -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) }