How can I create a route that will handle 403 errors from Express? I have default routes to catch 404/500 but it seems to stop before ever going to the router. Just stack dumps to screen.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To catch errors in express, use middleware that has four arguments:
To ensure the error is a 403 error, you can do something like: