Replies: 1 comment 1 reply
-
This already exists in v6, along with the conditional types that automatically determine the error interface based on error string. Check it out here: https://github.com/ethers-io/ethers.js/blob/v6-beta-exports/src.ts/utils/errors.ts#L53 :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Feature
At the moment, Ethers's errors don't have a type. See https://github.com/ethers-io/ethers.js/blob/master/packages/logger/src.ts/index.ts#L197
Yet, when inspecting them, they have more properties than the default/standard Error object (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error). They have some fields like
method
,code
and others. For example:I'd be great to add a dedicated type for them, that'd allow to not use
any
for them in our code.I can create the type in the
logger
package (https://github.com/ethers-io/ethers.js/tree/master/packages/logger), if there's interest for this addition ;)Code Example
No response
Beta Was this translation helpful? Give feedback.
All reactions