swarm/storage: Remove redundant error code switch

This commit is contained in:
lash 2018-02-05 19:28:40 +01:00
parent c7a45a512c
commit 4a9076d0e4

View file

@ -45,11 +45,8 @@ func NewResourceError(code int, s string) error {
panic("no such error code!") panic("no such error code!")
} }
r := &ResourceError{ r := &ResourceError{
err: s, err: s,
} code: code,
switch code {
case ErrNotFound, ErrIO, ErrUnauthorized, ErrInvalidValue, ErrDataOverflow, ErrNothingToReturn, ErrInvalidSignature, ErrNotSynced:
r.code = code
} }
return r return r
} }