Skip to content

Forward errors to clients - #113

Merged
louisinger merged 3 commits into
arkade-os:masterfrom
louisinger:error-handling
Jul 27, 2026
Merged

louisinger merged 3 commits into
arkade-os:masterfrom
louisinger:error-handling

Conversation

@louisinger

@louisinger louisinger commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Improved surfaced error details for transaction signing and submission, including clearer gRPC internal error messages that now reflect the underlying failure.
    • Adjusted error propagation to avoid generic “failed to process …” messages, making troubleshooting easier.
  • Tests
    • Relaxed assertions that depended on specific error text; tests now only verify that failures occur as expected.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd52ecfa-e1cd-4320-9b5e-4fc58fad192c

📥 Commits

Reviewing files that changed from the base of the PR and between 0db88c3 and 55e5e95.

📒 Files selected for processing (12)
  • test/asset_account_covenant_test.go
  • test/counter_contract_test.go
  • test/cross_input_script_validation_test.go
  • test/csfs_ecdsa_secp256r1_test.go
  • test/csfs_multischeme_test.go
  • test/groth16_bn254_test.go
  • test/htlc_test.go
  • test/onchain_test.go
  • test/pay_2_out_test.go
  • test/recursive_covenant_test.go
  • test/signed_pay_to_output_test.go
  • test/tx_test.go
💤 Files with no reviewable changes (12)
  • test/pay_2_out_test.go
  • test/counter_contract_test.go
  • test/csfs_multischeme_test.go
  • test/htlc_test.go
  • test/signed_pay_to_output_test.go
  • test/asset_account_covenant_test.go
  • test/recursive_covenant_test.go
  • test/cross_input_script_validation_test.go
  • test/tx_test.go
  • test/onchain_test.go
  • test/groth16_bn254_test.go
  • test/csfs_ecdsa_secp256r1_test.go

Walkthrough

Application errors are returned without added context, gRPC handlers expose underlying error messages, and negative emulator tests no longer require fixed wrapper-message text.

Changes

Error propagation

Layer / File(s) Summary
Return underlying application errors
internal/application/signer.go, internal/application/tx.go
Taproot signing and finalizer script-check failures are returned directly without wrapping.
Expose handler error messages
internal/interface/grpc/handlers/emulator_handler.go
gRPC handlers return underlying service and encoding error messages in Internal statuses.
Relax emulator failure assertions
test/*.go
Negative transaction and on-chain submission tests assert that errors occur without matching fixed error-message substrings.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: propagating underlying errors to clients instead of generic messages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/interface/grpc/handlers/emulator_handler.go`:
- Around line 74-78: Sanitize all errors crossing the gRPC boundary while
retaining raw causes for internal logging. In
internal/interface/grpc/handlers/emulator_handler.go:74-78, map SubmitTx errors
to stable public status messages; at 114-122, 188-192, and 231-239, sanitize
intent, proof-encoding, finalization, on-chain transaction, and encoding errors.
In internal/application/tx.go:97-98, wrap or replace the raw checkScript error
so script bytes and implementation details are not exposed directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a180855d-8896-4b14-87a0-64922c39e46e

📥 Commits

Reviewing files that changed from the base of the PR and between 1359823 and 0db88c3.

📒 Files selected for processing (3)
  • internal/application/signer.go
  • internal/application/tx.go
  • internal/interface/grpc/handlers/emulator_handler.go

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.

1 participant