1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00
zap/examples
renerocksai 8078b96d3f add on_uncaught_error behavior to zap.App, add on_error callbacks
zap.Endpont.Listener and zap.App now support on_error callbacks:

zap.Endpont.Listener.Settings contains an `on_error` optional callback
field.

zap.App supports those two callbacks:


/// ```zig
/// const MyContext = struct {
///     // You may (optionally) define the following global handlers:
///     pub fn unhandledRequest(_: *MyContext, _: Allocator, _: Request) anyerror!void {}
///     pub fn unhandledError(_: *MyContext, _: Request, _: anyerror) void {}
/// };
/// ```

The `endpoint` example has been updated to showcase `on_error`, and the
new example `app_errors` showcases `Context.unhandledError`.
2025-04-02 09:53:46 +02:00
..
accept added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
app add on_uncaught_error behavior to zap.App, add on_error callbacks 2025-04-02 09:53:46 +02:00
bindataformpost harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
cookies harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
endpoint add on_uncaught_error behavior to zap.App, add on_error callbacks 2025-04-02 09:53:46 +02:00
endpoint_auth Improved & generalized checkEndpoint functions 2025-03-30 19:37:40 +02:00
hello added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
hello2 added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
hello_json added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
http_params harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
https added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
middleware harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
middleware_with_endpoint harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
mustache harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
routes added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
senderror added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
sendfile harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
serve added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
simple_router added header to example main source files showing how to build & run 2025-03-30 19:40:08 +02:00
userpass_session_auth harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
websockets harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00