Closed cgarciae closed 9 years ago
I created this plugin to handle this
class Catch {
const Catch();
}
void ErrorCatchPlugin(app.Manager manager) {
manager.addRouteWrapper(Catch, (metadata, Map<String,String> pathSegments,
injector, app.Request request,
app.RouteHandler route) async {
try
{
var result = route(pathSegments, injector, request);
if (result is Future)
return await result;
else
return result;
}
catch (e, s)
{
return new Resp()
..error = "$e $s";
}
}, includeGroups: true);
I love plugins! However, Redstone should handle this by default.
Thanks for reporting.
I've released v0.5.21 with a fix for this. Please confirm.
Worked :)
Here is a minimal case