Skip to content

Implement StellarError #35

Description

@codebestia

Raised when a Stellar/Horizon call fails — rejected transaction, missing trustline, insufficient balance. Should wrap the underlying stellar_sdk exception and expose the Stellar result code for programmatic handling.

Proposed Steps:

  • Define StellarError(ShadeError) in errors.py.
  • Add stellar_result_code: Optional[str] and original_error: Exception.
  • Catch stellar_sdk exceptions in the Stellar integration layer and re-raise as StellarError.

Acceptance Criteria:

  • A rejected Stellar transaction raises StellarError with the Horizon result code.
  • error.original_error gives access to the raw stellar_sdk exception.
  • A trustline-missing error surfaces as StellarError with a descriptive message.

Activity

  1. GBOYEE commented on Jul 20, 2026

    @GBOYEE

    Hi — I can take this on. I can handle this one. I'll fix it and add a test to lock it down. I'll open a PR referencing this shortly once assigned.

  2. daveades commented on Jul 27, 2026

    @daveades
    Contributor

    Hi @codebestia, I'd like to work on this issue.

    How I understand it

    When a Stellar or Horizon call fails, the raw stellar_sdk exception leaks out and callers have nothing stable to catch. StellarError wraps it so callers catch one SDK exception type, can read the Stellar result code to handle cases like a rejected transaction programmatically, and can still reach the original exception when they need the raw details.

    What I will do

    1. Define StellarError(ShadeError) in errors.py with stellar_result_code: Optional[str] and original_error: Exception.
    2. In the Stellar integration layer, catch stellar_sdk exceptions and re-raise as StellarError, pulling the Horizon result code out of the response when it is present.
    3. Give the trustline missing case a clear message, since a bare result code like op_no_trust tells a new user nothing.

    Tests, one for each acceptance criterion

    1. A rejected Stellar transaction raises StellarError carrying the Horizon result code.
    2. error.original_error returns the raw stellar_sdk exception.
    3. A missing trustline surfaces as StellarError with a descriptive message.

    I can open a PR in 1 to 2 days.

  3. grantfox-oss commented on Jul 27, 2026

    @grantfox-oss

    🦊 GrantFox — @daveades has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #35)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  4. grantfox-oss commented on Jul 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @daveades's PR #54 was approved and merged by @codebestia.

    🏆 @daveades: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (83 total points). Track your full progress on GrantFox.

    👏 Great work, @daveades! Keep contributing to ShadeProtocol.

  5. added a commit that references this issue on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions