forked from TrueCloudLab/frostfs-node
[#1689] morph: Remove frostfsError
type
It has no custom methods defined, only adds `frostfs error: ` prefix to the error message. The utility of this prefix is debatable, failed invocations already have `invocation failed` prefix. Change-Id: If25ebb3679497f3f10acde43b596c81d52351907 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
52367dc9b2
commit
3d771aa21c
4 changed files with 7 additions and 23 deletions
|
@ -151,20 +151,6 @@ func (e *notHaltStateError) Error() string {
|
|||
)
|
||||
}
|
||||
|
||||
// implementation of error interface for FrostFS-specific errors.
|
||||
type frostfsError struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func (e frostfsError) Error() string {
|
||||
return fmt.Sprintf("frostfs error: %v", e.err)
|
||||
}
|
||||
|
||||
// wraps FrostFS-specific error into frostfsError. Arg must not be nil.
|
||||
func wrapFrostFSError(err error) error {
|
||||
return frostfsError{err}
|
||||
}
|
||||
|
||||
// Invoke invokes contract method by sending transaction into blockchain.
|
||||
// Returns valid until block value.
|
||||
// Supported args types: int64, string, util.Uint160, []byte and bool.
|
||||
|
@ -228,7 +214,7 @@ func (c *Client) TestInvokeIterator(cb func(stackitem.Item) error, batchSize int
|
|||
if err != nil {
|
||||
return err
|
||||
} else if val.State != HaltState {
|
||||
return wrapFrostFSError(¬HaltStateError{state: val.State, exception: val.FaultException})
|
||||
return ¬HaltStateError{state: val.State, exception: val.FaultException}
|
||||
}
|
||||
|
||||
arr, sid, r, err := unwrap.ArrayAndSessionIterator(val, err)
|
||||
|
@ -292,7 +278,7 @@ func (c *Client) TestInvoke(contract util.Uint160, method string, args ...any) (
|
|||
}
|
||||
|
||||
if val.State != HaltState {
|
||||
return nil, wrapFrostFSError(¬HaltStateError{state: val.State, exception: val.FaultException})
|
||||
return nil, ¬HaltStateError{state: val.State, exception: val.FaultException}
|
||||
}
|
||||
|
||||
success = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue