MCPcopy Create free account
hub / github.com/wevm/viem / getCallError

Function getCallError

src/utils/errors/getCallError.ts:24–46  ·  view source on GitHub ↗
(
  err: err,
  {
    docsPath,
    ...args
  }: CallParameters & {
    chain?: Chain | undefined
    docsPath?: string | undefined
  },
)

Source from the content-addressed store, hash-verified

22}
23
24export function getCallError<err extends ErrorType<string>>(
25 err: err,
26 {
27 docsPath,
28 ...args
29 }: CallParameters & {
30 chain?: Chain | undefined
31 docsPath?: string | undefined
32 },
33): GetCallErrorReturnType<err> {
34 const cause = (() => {
35 const cause = getNodeError(
36 err as {} as BaseError,
37 args as GetNodeErrorParameters,
38 )
39 if (cause instanceof UnknownNodeError) return err as {} as BaseError
40 return cause
41 })()
42 return new CallExecutionError(cause, {
43 docsPath,
44 ...args,
45 }) as GetCallErrorReturnType<err>
46}

Callers 4

createAccessListFunction · 0.85
callFunction · 0.85
estimateGasFunction · 0.85

Calls 1

getNodeErrorFunction · 0.85

Tested by

no test coverage detected