-
Notifications
You must be signed in to change notification settings - Fork 120
1994 taquito package error improvement #2559
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
Conversation
…o-package-error-improvement
✅ Deploy Preview for taquito-test-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/. Published packages:
|
A new deploy preview is available on Netlify at https://d464463--tezostaquito.netlify.app |
super(); | ||
this.name = 'InvalidTokenMetadata'; | ||
this.message = | ||
'Non-compliance with the TZIP-012 standard. The required property `decimals` is missing.'; |
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.
I think it's useful to add the Token Metadata that has cause the failure. That helps the user diagnose their problem.
@@ -55,7 +55,7 @@ export class InvalidAddressError extends ParameterValidationError { | |||
super(); | |||
this.name = 'InvalidAddressError'; | |||
this.message = `Invalid address "${address}"`; | |||
errorDetail ? (this.message += ` ${errorDetail}.`) : null; | |||
this.message += errorDetail ? ` ${errorDetail}.` : '.'; |
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.
what does an example of an error message for this look like?
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.
something like this Invalid address "tz1iedjFYksExq8snZK9MNo4AvXHG" failed checksum.
@@ -147,14 +147,14 @@ describe('Metadata provider test', () => { | |||
done(); | |||
}); | |||
|
|||
it('Should fail with InvalidMetadata when metadata are not a JSON object', async (done) => { | |||
it('Should fail with InvalidContractMetadata when metadata are not a JSON object', async (done) => { |
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.
I think it should be 'is not a JSON object'
super(); | ||
this.name = 'BigMapMetadataNotFound'; | ||
this.message = | ||
'Non-compliance with the TZIP-016 standard. No big map named metadata was found in the contract storage.'; |
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.
Same here, including the data can help with diagnostincs
* @category Error | ||
* @description Error indicates missing big map metadata (non compliance to the TZIP-16 standard) | ||
*/ | ||
export class BigMapMetadataNotFound extends TaquitoError { |
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.
There is a bit of inconsistency in this file: Some classes end with Error
while others don't
@@ -97,7 +97,7 @@ export const createOriginationOperation = async ({ | |||
}; | |||
|
|||
if (isNaN(Number(balance))) { | |||
throw new IntegerError(`Unexpected Invalid Integer ${balance}`); | |||
throw new InvalidBalanceError(`Invalid Balance "${balance}", can't convert to a number`); |
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.
throw new InvalidBalanceError(`Invalid Balance "${balance}", can't convert to a number`); | |
throw new InvalidBalanceError(`Invalid Balance "${balance}", cannot be converted to a number`); |
Thank you for your contribution to Taquito.
Before submitting this PR, please make sure:
In this PR, please also make sure:
closes #TICKETNUMBER
in the description box (when applicable)Release Note Draft Snippet
If relevant, please write a summary of your change that will be suitable for
inclusion in the Release Notes for the next Taquito release.
error improvement of package @taquito/taquito, @taquito/tzip12 and @taquito/tzip16
Breaking Changes: