ethers.js/lib.esm/utils/errors.js
2022-09-05 16:57:11 -04:00

18 lines
399 B
JavaScript

//export type TransactionReceipt {
//}
/**
* try {
* // code....
* } catch (e) {
* if (isError(e, errors.CALL_EXCEPTION)) {
* console.log(e.data);
* }
* }
*/
export function isError(error, code) {
return (error && error.code === code);
}
export function isCallException(error) {
return isError(error, "CALL_EXCEPTION");
}
//# sourceMappingURL=errors.js.map