mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 20:14:39 +00:00
@@ -53,7 +53,12 @@ export function get_server_route_handler(routes: ServerRoute[]) {
|
||||
};
|
||||
|
||||
try {
|
||||
handle_method(req, res, handle_next);
|
||||
const result = handle_method(req, res, handle_next);
|
||||
|
||||
// catch failures in async functions
|
||||
if (Promise.resolve(result) === result) {
|
||||
result.catch(handle_next);
|
||||
}
|
||||
} catch (err) {
|
||||
handle_next(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user