function makeError<K, T>(
   message, 
   code, 
   info?): T

Returns a new Error configured to the format quais emits errors, with the message, ErrorCode code and additional properties for the corresponding quaisError.

Each error in quais includes the version of quais, a machine-readable ErrorCode, and depending on code, additional required properties. The error message will also include the message, quais version, code and all additional properties, serialized.

Type parameters

Type parameter
K extends ErrorCode
T extends
| UnknownError
| InvalidArgumentError
| BadDataError
| NotImplementedError
| UnsupportedOperationError
| NetworkError
| ServerError
| TimeoutError
| CancelledError
| BufferOverrunError
| NumericFaultError
| MissingArgumentError
| UnexpectedArgumentError
| CallExceptionError
| InsufficientFundsError
| NonceExpiredError
| ReplacementUnderpricedError
| TransactionReplacedError
| TransactionNotFoundError
| TransactionAlreadyKnown
| ActionRejectedError
| ProviderFailedToInitializeError

Parameters

ParameterTypeDescription
messagestringThe error message.
codeKThe error code.
info?ErrorInfo<T>Additional properties for the error.

Returns

T

The new error.

Source

utils/errors.ts:691