Repository navigation
v1.0.0
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
Dointo two clearer hooks:Tap(...)runs on successTapError(...)runs on failure
-
Functional refactor across the library for a more idiomatic style (sync + async).
💥 Breaking Changes
-
Error.Descriptionrenamed toError.Message. -
Error types update:
- Added:
Timeout - Removed:
Forbidden(migrate toUnauthorized,Conflict, or define a custom error).
- Added:
🔧 Behavior Changes
GetMetadata(...)now returnsnullwhen a key is missing (instead of throwing).
🚀 Migration Guide (0.7.0 → 1.0.0)
- Replace
Do(...)withTap(...).TapError(...). - Rename
error.Descriptiontoerror.Message. - Swap out
Forbiddenwith another built-in error type or create a custom one. - Add null checks where
GetMetadata(...)is used.