diff --git a/pkg/eosclient/eosgrpc/eosgrpc.go b/pkg/eosclient/eosgrpc/eosgrpc.go index c2ca7a8d789..ff21d202d4a 100644 --- a/pkg/eosclient/eosgrpc/eosgrpc.go +++ b/pkg/eosclient/eosgrpc/eosgrpc.go @@ -216,7 +216,14 @@ func (c *Client) getRespError(rsp *erpc.NSResponse, err error) error { return nil } - return errtypes.InternalError("Err from EOS: " + fmt.Sprintf("%#v", rsp.Error)) + switch rsp.Error.Code { + case 16: // EBUSY + return eosclient.FileIsLockedError + case 17: // EEXIST + return eosclient.AttrAlreadyExistsError + default: + return errtypes.InternalError(fmt.Sprintf("%s (code: %d)", rsp.Error.Msg, rsp.Error.Code)) + } } // Common code to create and initialize a NSRequest.