Languages
[Edit]
EN

Express.js - handle exception

10 points
Created by:
Sujay
512

In this article, we would like to show how to handle exception in Express.js.

By exceptions handling we are able to:

  • send to user safe message when exception occurred hiding exception's sensitive information,
  • display in console details about occured exception.

Quick solution:

 

Reusable logic

Edit

In this section, you can find reusable functions that let to simplyfy your's application source code.

index.js file:

 

request.js file:

 

Alternative titles

  1. Express.js - catch exception
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join