Class: CCIPSourcePoolRevertError
Defined in: errors/specialized.ts:3794
Thrown when the source pool's lockOrBurn simulation reverts with a genuine on-chain gate —
sender allowlist, outbound rate limit, finality gate, chain not allowed. The real ccipSend
would revert with the same cause, so the send is blocked at preflight. Like
CCIPDestExecutionRevertError, the raw encoded revert is carried in context.revert for
the caller to decode with EVMChain.parse and branch on the exact cause.
Reverts attributable to the simulation setup itself (the pool's token balance is only best-effort state-overridden) are NOT raised as this error — they fall back to the decimals default instead of blocking.
Example
import { CCIPSourcePoolRevertError, EVMChain } from '@chainlink/ccip-sdk'
try {
await estimateReceiveExecution({ source, dest, routerOrRamp, message })
} catch (error) {
if (error instanceof CCIPSourcePoolRevertError) {
const parsed = EVMChain.parse(error.context.revert)
console.log(`ccipSend would revert: ${parsed?.error}`, 'retryable:', error.isTransient)
}
}
Extends
Constructors
Constructor
new CCIPSourcePoolRevertError(
detail:string,options?:CCIPErrorOptions):CCIPSourcePoolRevertError
Defined in: errors/specialized.ts:3802
Creates a source-pool revert error.
Parameters
| Parameter | Type | Description |
|---|---|---|
detail | string | Best-effort decoded revert for the message (name + data, or raw selector). |
options? | CCIPErrorOptions | Optional error options. Put the raw encoded revert in context.revert for the caller to parse, and pass isTransient when the revert is one that recovers on its own. |
Returns
CCIPSourcePoolRevertError
Overrides
Properties
_isCCIPError
readonly_isCCIPError:true
Defined in: errors/CCIPError.ts:30
Brand for cross-module identification (dual package hazard).
Inherited from
code
readonlycode:CCIPErrorCode
Defined in: errors/CCIPError.ts:32
Machine-readable error code.
Inherited from
context
readonlycontext:Record<string,unknown>
Defined in: errors/CCIPError.ts:34
Structured context (IDs, addresses).
Inherited from
isTransient
readonlyisTransient:boolean
Defined in: errors/CCIPError.ts:36
True if retry may succeed.
Inherited from
name
readonlyname:"CCIPSourcePoolRevertError"='CCIPSourcePoolRevertError'
Defined in: errors/specialized.ts:3795
Overrides
recovery?
readonlyoptionalrecovery?:string
Defined in: errors/CCIPError.ts:40
Recovery suggestion.
Inherited from
retryAfterMs?
readonlyoptionalretryAfterMs?:number
Defined in: errors/CCIPError.ts:38
Retry delay in ms.
Inherited from
Methods
toJSON()
toJSON():
Record<string,unknown>
Defined in: errors/CCIPError.ts:105
Serializes the error for logging.
Use this instead of JSON.stringify(error) directly, as Error properties
are non-enumerable and would be lost.
Returns
Record<string, unknown>
An object containing all error properties
Inherited from
from()
staticfrom(error:unknown,code?:CCIPErrorCode):CCIPError
Defined in: errors/CCIPError.ts:89
Wraps an unknown caught value in a CCIPError.
Useful for normalizing errors in catch blocks.
Parameters
| Parameter | Type | Description |
|---|---|---|
error | unknown | The error to wrap |
code? | CCIPErrorCode | Optional error code (defaults to 'UNKNOWN') |
Returns
A CCIPError wrapping the original error
Inherited from
isCCIPError()
staticisCCIPError(error:unknown):error is CCIPError
Defined in: errors/CCIPError.ts:73
Type guard for CCIPError.
Prefer this over instanceof to handle the dual package hazard
when multiple versions of the SDK may be present.
Parameters
| Parameter | Type | Description |
|---|---|---|
error | unknown | The error to check |
Returns
error is CCIPError
True if the error is a CCIPError instance