Skip to content

Conversation

@ivan-angjelkoski
Copy link
Contributor

@ivan-angjelkoski ivan-angjelkoski commented Dec 17, 2025

This pull request enhances error handling and messaging across the exceptions and SDK packages, particularly for gRPC and chain transaction errors. The main improvements include better extraction and mapping of error codes and modules from gRPC messages, introduction of new error codes, and more user-friendly error messages.

Error handling improvements:

  • BaseGrpcConsumer.ts: Added methods to extract ABCI error codes and codespace modules from gRPC error messages, and updated the centralized error handler to throw a TransactionException with detailed context when chain error details are present. This enables more accurate and user-friendly error reporting for chain-related errors.
  • base.ts, maps.ts: Updated the error context structure and parsing logic to support a new contextCode field, ensuring that ABCI codes are correctly propagated and mapped throughout the error handling pipeline. [1] [2]

Error code and message mapping:

  • codes.ts: Introduced new error codes ErrInvalidClosingDirection and ErrInvalidNotional for the chain exchange module, enabling more granular error identification.
  • messages.ts: Mapped the new ErrInvalidClosingDirection error code to a descriptive message, improving clarity for end users.

User-facing error messages:

  • maps.ts: Enhanced the error message mapping logic to use parseErrorMessage for fallback messages, ensuring that users receive clearer and more informative error descriptions when specific mappings are unavailable.

These changes collectively improve the robustness and clarity of error handling, especially for transaction failures and gRPC communication issues.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/error-message-fix

Comment @coderabbitai help to get the list of available commands and usage tips.

@ThomasRalee ThomasRalee merged commit 9ef214e into feat/proto-v2 Dec 17, 2025
13 checks passed
@ThomasRalee ThomasRalee deleted the chore/error-message-fix branch December 17, 2025 16:06
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.

3 participants