Skip to content
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(sdk): Make the "error handler" give more information #777

Merged
merged 11 commits into from
Nov 8, 2024

Conversation

Chirag-S-Kotian
Copy link
Contributor

@Chirag-S-Kotian Chirag-S-Kotian commented Oct 23, 2024

What does this PR do?

This PR refactors the error handling mechanism in the SDK to handle various error scenarios more effectively. It improves the clarity and specificity of error messages returned when a transaction fails, especially when dealing with contract function revert errors.

Related ticket

Fixes #769

Type of change

  • Chore
  • Bug fix
  • New feature
  • Documentation update

Check list

  • Unit tests for any smart contract change
  • Contracts and functions are documented

@alainncls alainncls changed the title Refactor Error Handler for Improved Error Messaging chore(sdk): Make the "error handler" give more information Oct 23, 2024
sdk/src/utils/errorHandler.ts Outdated Show resolved Hide resolved
sdk/src/utils/errorHandler.ts Outdated Show resolved Hide resolved
@alainncls
Copy link
Collaborator

@Chirag-S-Kotian there seems to be an issue with the unit tests, I'll look at them once they're fixed, ok?
I've added 2 small comments on the implementation itself 🙂

@Chirag-S-Kotian
Copy link
Contributor Author

Okay I will implement that and if there is an error in unit test please let me know.
Thank you 🙏😊.

@Chirag-S-Kotian
Copy link
Contributor Author

hy @alainncls help me to run the tests locally using pnpm ,tell me the exact command to test the errorhandler.

@alainncls
Copy link
Collaborator

hy @alainncls help me to run the tests locally using pnpm ,tell me the exact command to test the errorhandler.

If you want to run all unit tests for the SDK: pnpm --filter "{sdk}" run test:unit (from the root of the project)
And if you want to run only the errorHandler unit tests: pnpm --filter "{sdk}" run test:unit -- src/utils/errorHandler.test.ts

Hope that helps!

@Chirag-S-Kotian
Copy link
Contributor Author

@Nmhth17 review 😌 please .

@alainncls alainncls merged commit 6fd6a63 into Consensys:dev Nov 8, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Make the "error handler" give more information
4 participants