Skip to content

Add error handling best practices: replace unwrap/expect in library code #31

@jose-compu

Description

@jose-compu

Description

Library code should propagate errors via Result rather than panicking with unwrap() or expect(). While examples and tests may use these, the core library modules should handle errors gracefully.

Proposed Changes

  • Audit src/ (excluding examples) for unwrap() and expect() calls
  • Replace with proper error propagation using the ? operator and ChaincraftError variants
  • Add new error variants to ChaincraftError as needed
  • Keep unwrap()/expect() in examples and tests where appropriate

Impact

More robust library that does not panic on recoverable errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityStatic analysis, lints, and code standards

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions