Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 784 Bytes

File metadata and controls

28 lines (16 loc) · 784 Bytes

@grainlify/contracts-sdk


@grainlify/contracts-sdk / parseContractError

Function: parseContractError()

parseContractError(error): ContractError

Defined in: src/errors.ts:300

Parse a contract error from a Soroban response by matching the error message. Falls back to a generic ContractError when no pattern matches.

Checks are ordered from most-specific to least-specific so that the more descriptive min/max messages are matched before the generic INVALID_AMOUNT fallback.

Parameters

error

any

Returns

ContractError