forked from TrueCloudLab/frostfs-s3-gw
Change NotFound error for objectFindID
method should return gRPC status error Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
5258342881
commit
5eae2aac78
1 changed files with 3 additions and 1 deletions
|
@ -13,6 +13,8 @@ import (
|
||||||
"github.com/nspcc-dev/neofs-s3-gate/api/pool"
|
"github.com/nspcc-dev/neofs-s3-gate/api/pool"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -226,7 +228,7 @@ func (n *layer) objectFindID(ctx context.Context, cid refs.CID, name string, put
|
||||||
return id, nil
|
return id, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return id, errors.New("object not found")
|
return id, status.Error(codes.NotFound, "object not found")
|
||||||
} else if ln == 1 {
|
} else if ln == 1 {
|
||||||
return result[0], nil
|
return result[0], nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue