-
Notifications
You must be signed in to change notification settings - Fork 14
Error Handling
Alex edited this page Aug 12, 2018
·
2 revisions
Throw a new error is pretty easy
import sendError from "../util/error";
[...]
app.get("/", (req, res) => {
do.myWork().then(() => {
// Handle something
}).catch((err) => {
sendError(req, res, err); // Send the Error
});
});
This will show a 500 page and if the hostname is localhost:3000
or dev.savetheinternet.info
it will show the error message