added error event hooks

This commit is contained in:
Gani Georgiev
2022-12-02 16:36:15 +02:00
parent 23fbfab63a
commit 02f72638b8
7 changed files with 70 additions and 9 deletions
+10
View File
@@ -92,6 +92,16 @@ type App interface {
// allowing you to adjust its options and attach new routes.
OnBeforeServe() *hook.Hook[*ServeEvent]
// OnBeforeApiError hook is triggered right before sending an error API
// response to the client, allowing you to further modify the error data
// or to return a completely different API response (using [hook.StopPropagation]).
OnBeforeApiError() *hook.Hook[*ApiErrorEvent]
// OnAfterApiError hook is triggered right after sending an error API
// response to the client.
// It could be used to log the final API error in external services.
OnAfterApiError() *hook.Hook[*ApiErrorEvent]
// ---------------------------------------------------------------
// Dao event hooks
// ---------------------------------------------------------------