You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is an example of how you would disable the default error handling so far. It's worth noting that there is no default error handling for middleware functions.
using Oxygen
using HTTP
@get"/"function(req::HTTP.Request)
return"hello world!"end@get"/bad"function(req::HTTP.Request)
throw("whoops")
"hello"endfunctionerrorcatcher(handle)
function(req)
tryreturnhandle(req)
catch e
return HTTP.Response(500, "here's a custom error response")
endendend# start the web serverserve(middleware=[errorcatcher], catch_errors=false)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@louisponet
Below is an example of how you would disable the default error handling so far. It's worth noting that there is no default error handling for middleware functions.
What do you think? Does this solve the issue you brought up here: https://discourse.julialang.org/t/ann-oxygen-jl-v1-1-6-cron-scheduling/97291/3?u=ndortega
Beta Was this translation helpful? Give feedback.
All reactions