MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / parseError

Method parseError

lib.commonjs/abi/interface.js:1073–1081  ·  view source on GitHub ↗

* Parses a revert data, finding the matching error and extracts * the parameter values along with other useful error details. * * If the matching error cannot be found, returns null.

(data)

Source from the content-addressed store, hash-verified

1071 * If the matching error cannot be found, returns null.
1072 */
1073 parseError(data) {
1074 const hexData = (0, index_js_3.hexlify)(data);
1075 const fragment = this.getError((0, index_js_3.dataSlice)(hexData, 0, 4));
1076 if (!fragment) {
1077 return null;
1078 }
1079 const args = this.#abiCoder.decode(fragment.inputs, (0, index_js_3.dataSlice)(hexData, 4));
1080 return new ErrorDescription(fragment, fragment.selector, args);
1081 }
1082 /**
1083 * Creates a new [[Interface]] from the ABI %%value%%.
1084 *

Callers

nothing calls this directly

Calls 2

getErrorMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected