@0x/utils
: Tweak RevertError
to produce a meaningful Error
message/stack trace.
`@0x/utils`: Add more `RevertError` decoding/transforming functions (such as `decodeThrownErrorAsRevertError()`)
This commit is contained in:
committed by
Amir Bandeali
parent
d480f8d82a
commit
eaa4373a18
@@ -17,7 +17,7 @@ class DescendantRevertError extends StringRevertError {
|
||||
|
||||
class CustomRevertError extends RevertError {
|
||||
public constructor(message?: string) {
|
||||
super('CustomRevertError(string message)', { message });
|
||||
super('CustomRevertError', 'CustomRevertError(string message)', { message });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('RevertError', () => {
|
||||
it('should throw when registering an already registered signature', () => {
|
||||
class CustomRevertError2 extends RevertError {
|
||||
public constructor() {
|
||||
super(new CustomRevertError().signature, {});
|
||||
super('CustomRevertError2', new CustomRevertError().signature, {});
|
||||
}
|
||||
}
|
||||
expect(() => RevertError.registerType(CustomRevertError2)).to.throw();
|
||||
|
Reference in New Issue
Block a user