Skip to content

chore(sdk): Make the "error handler" give more information#777

Merged
alainncls merged 11 commits intoConsensys:devfrom
Chirag-S-Kotian:dev
Nov 8, 2024
Merged

chore(sdk): Make the "error handler" give more information#777
alainncls merged 11 commits intoConsensys:devfrom
Chirag-S-Kotian:dev

Conversation

@Chirag-S-Kotian
Copy link
Copy Markdown
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
Comment thread sdk/src/utils/errorHandler.ts Outdated
Comment thread sdk/src/utils/errorHandler.ts Outdated
@alainncls
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@Nmhth17 review 😌 please .

Comment thread sdk/src/utils/errorHandler.ts
@alainncls alainncls merged commit 6fd6a63 into Consensys:dev Nov 8, 2024
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