-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f138122
commit beffaec
Showing
3 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# `src/exceptions` | ||
|
||
The `src/exceptions` directory contains all of the custom [ATH::Exceptions::HTTPException](https://athenaframework.org/Framework/Exceptions/HTTPException/) and/or `::Exception` types for the application. Having specialized exception types can help by providing more helpful errors, allowing more specific state to be included in the exception instance, and allow more targeted logic in `rescue` blocks and/or within an [exception](https://athenaframework.org/components/#8-exception-handling) event listener. | ||
The `src/exceptions` directory contains all of the custom [ATH::Exception::HTTPException](https://athenaframework.org/Framework/Exception/HTTPException/) and/or `::Exception` types for the application. Having specialized exception types can help by providing more helpful errors, allowing more specific state to be included in the exception instance, and allow more targeted logic in `rescue` blocks and/or within an [exception](https://athenaframework.org/getting_started/middleware/#8-exception-handling) event listener. | ||
|
||
Also leveraging `::Exception` in the service layer allows for more flexibility as those exceptions would be valid in both HTTP and CLI contexts. | ||
While if within the HTTP context they could easily be rescued and a more specific HTTP exception be raised in its place. |