Skip to content

Foundry CLI 0.2.1 – Standardized Response & Error Handling

Choose a tag to compare

@Caio26Gualberto Caio26Gualberto released this 07 Apr 03:37
· 4 commits to master since this release

🚀 Release v0.2.1

This release introduces a major improvement in how responses and errors are handled across the application, improving consistency, maintainability, and architectural separation.

✔ Introduced a standardized Result pattern in the application layer for handling success and failure scenarios
✔ Replaced exception-driven business logic with explicit result-based flow control
✔ Implemented structured error handling using Error and ErrorType for better semantic clarity
✔ Decoupled application logic from HTTP concerns (no direct status handling outside controllers)
✔ Simplified controllers by centralizing error-to-HTTP mapping (MapError)
✔ Refactored validation flow to return consistent and predictable responses
✔ Improved overall code readability and testability

⚠️ Note:
Business rule errors are no longer handled via exceptions. Instead, they are returned through the Result pattern. Exceptions are now reserved for unexpected or infrastructure-related failures and are handled by middleware.

This is still a pre-release version. While the new response pattern is stable, further refinements and standardizations (such as response extensions and validation pipelines) may be introduced in future iterations.