bdk-ffi icon indicating copy to clipboard operation
bdk-ffi copied to clipboard

Add ADR document on errors

Open thunderbiscuit opened this issue 9 months ago • 2 comments

This PR is very much up for review and discussion. I figured that a good way to lay out correctly a solution would be to write it out. We can hash out the specifics directly on this PR.

thunderbiscuit avatar Apr 26 '24 18:04 thunderbiscuit

Walkthrough

This update introduces a new document, 03-errors.md, which addresses the handling of errors in Rust bitcoin libraries, particularly focusing on the integration with the uniffi tool. The document outlines the challenges and decisions related to error handling, emphasizing the importance of meaningful error messages in language bindings.

Changes

File Summary
docs/adr/03-errors.md New document discussing error handling strategies in Rust bitcoin libraries using uniffi.

Recent Review Details

Configuration used: CodeRabbit UI Review profile: CHILL

Commits Files that changed from the base of the PR and between e609b57bff1161f9d7030189f018feed86024a3c and c198a3476feb0c3bfdd1a583841757265dee479c.
Files selected for processing (1)
  • docs/adr/03-errrors.md (1 hunks)
Additional Context Used
LanguageTool (14)
docs/adr/03-errrors.md (14)

Near line 7: Possible spelling mistake found. Context: ...we use to produce language bindings for bdk-ffi libraries is [uniffi]. While the librar...


Near line 7: Possible spelling mistake found. Context: ...uage bindings for bdk-ffi libraries is [uniffi]. While the library is powerful, it als...


Near line 7: Possible spelling mistake found. Context: ...t errors; we must choose between simple enums that have variants but not data associa...


Near line 7: Possible spelling mistake found. Context: ...ata associated with them (for example a TxidError would not be able to return the specif...


Near line 7: Possible spelling mistake found. Context: ...ould not be able to return the specific txid that triggered the error), or more comp...


Near line 7: Possible spelling mistake found. Context: ...g if the object has no data, and just a strignified version of the fields if it does have a...


Near line 11: The singular determiner ‘this’ may not agree with the plural noun ‘decisions’. Did you mean “these”? Context: ...detail in [issue #509]. Some aspects of this decisions include: - Expectations from ...


Near line 12: A comma might be missing here. Context: ...e libraries in different languages (for example Kotlin users expect a message field o...


Near line 13: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short). Context: ...of maintaining the errors as they evolve and we expose more and more of the Rust BDK...


Near line 14: Possible spelling mistake found. Context: ...ce-to-have features (some fields can be stringified without loss of information, some canno...


Near line 18: Possible spelling mistake found. Context: ... leverage two different approaches that uniffi offers for exposing errors, and using t...


Near line 20: Possible missing article found. Context: ...pler to maintain option, which provides better, costumized error message with a `messa...


Near line 20: Possible spelling mistake found. Context: ...maintain option, which provides better, costumized error message with a message field pr...


Near line 20: Possible spelling mistake found. Context: ... with a message field provided by the thiserror library. Those errors cannot have fiel...


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 26 '24 18:04 coderabbitai[bot]

Great idea. I'm going to ruminate on this a bit over the next week (and add comments/thoughts as needed)

reez avatar Apr 26 '24 19:04 reez