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
Proposal: Add a runtime hook (something like interpretErrors) that adds a handler that runs when an endpoint throws an error. The handler can return a ResponseTuple array or undefined (call next handler or send a 500 response).
interpretErrors((error,req)=>{if(req.method=='post'&&error.message=='Unexpected end of JSON input'){return[400,null,{json: {error: 'malformed-json'}}]}})
The text was updated successfully, but these errors were encountered:
Proposal: Add a runtime hook (something like
interpretErrors
) that adds a handler that runs when an endpoint throws an error. The handler can return aResponseTuple
array or undefined (call next handler or send a 500 response).The text was updated successfully, but these errors were encountered: