mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-24 07:55:29 +00:00
handle errors. (TODO: handle errors *nicely*)
This commit is contained in:
@@ -39,6 +39,7 @@ module.exports = function connect(opts) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
for (const route of routes) {
|
||||
if (route.test(url)) {
|
||||
req.params = route.exec(url);
|
||||
@@ -89,5 +90,10 @@ module.exports = function connect(opts) {
|
||||
}
|
||||
|
||||
next();
|
||||
} catch(err) {
|
||||
// TODO nice error pages
|
||||
res.status(500);
|
||||
res.end(err.message);
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user