Skip to content

v1.0.0

Choose a tag to compare

@cds-git cds-git released this 27 Aug 18:17
· 45 commits to main since this release

The first major stable release of BetterResult is here!
This version refines the API, simplifies error handling, and brings clarity to result composition.


✨ What’s New

  • Split Do into two clearer hooks:

    • Tap(...) runs on success
    • TapError(...) runs on failure
  • Functional refactor across the library for a more idiomatic style (sync + async).


💥 Breaking Changes

  • Error.Description renamed to Error.Message.

  • Error types update:

    • Added: Timeout
    • Removed: Forbidden (migrate to Unauthorized, Conflict, or define a custom error).

🔧 Behavior Changes

  • GetMetadata(...) now returns null when a key is missing (instead of throwing).

🚀 Migration Guide (0.7.0 → 1.0.0)

  1. Replace Do(...) with Tap(...).TapError(...).
  2. Rename error.Description to error.Message.
  3. Swap out Forbidden with another built-in error type or create a custom one.
  4. Add null checks where GetMetadata(...) is used.