-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: replacing all generic errors with FuelError
#2549
chore: replacing all generic errors with FuelError
#2549
Conversation
@msensys does this pick up all occurences? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msensys does this pick up all occurences?
It believe not - hence the "Relates to"?
Sorry @msensys was just trying to validate why the validate changeset CI stage hadn't run so converted to draft |
Maybe not. I will send some commits to pick up all occurrences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work!
To fully wrap this up, can you please go to the tests that are expecting these errors and use the expectToThrowFuelError
utility?
For example, for this error, there exists this test. You'd change the test to look like this:
it('throws when setting configurable but predicate has none', async () => {
await expectToThrowFuelError(
() =>
new Predicate({
bytecode: predicateBytesTrue,
abi: predicateAbiTrue,
provider: wallet.provider,
inputData: ['NADA'],
configurableConstants: {
constant: 'NADA',
},
}),
new FuelError(
ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,
'Predicate has no configurable constants to be set'
)
);
});
You can do a repo-wide search for the expected error message on each error you changed and there should be a corresponding test which you'd change as shown above. If a test doesn't exist for the error, you're welcome to add it.
Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
@msensys I see that this PR still needs some work as there are quite a few places we still |
Note that we should use the However, to apply this, you'll need to wait until we merge this:
|
Also, |
@mvares did you need any assistance with this one? |
Some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work!
Oops, didn't see that it's in draft 😅 I'll revoke the approval but, regardless, the PR seems good. |
@mvares do you need any further guidance here? I can see doing a rudimentary search in my editor there are still quite a few places where |
@maschad, sorry for about that. Currently, other issues are on my radar. I think it’s better I unassign and to close this PR. |
There is surely value in the PR in it's current state - I'm for merging as is, and not closing the issue. |
I couldn't agree more. I'm afraid we can't restore branches on forks tho. |
That's a good point @petertonysmith94 , @mvares if you have the branch locally you could restore it and re-open a PR, otherwise you could recreate the changes on a single commit. If you re-open the PR I suppose instead of using the Closes keyword you could use the Related keyword. |
I believe I still have the branch locally. I will check it out. |
Error
toFuelError
#2001