O'Reilly logo

Secure Your Node.js Web Application by Karl Duuna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Don’t Forget About Proper Error Handling

Now that your server is talking to the world and you can see what’s going on there, we have another important topic to discuss—errors.

Due to the single-threaded nature of Node.js and the lack of default configuration, a single error could bring the entire application crashing down, something we definitely don’t want.

Error handling has been left in the hands of the programmers, and because of the nature of Node.js, it’s somewhat complicated to implement correctly.

Let’s investigate the various ways to address error handling in Node.js. There are several layers of implementation, and the best one to use would depend on the scale and nature of the application.

Keep the Process Alive

First, we want to prevent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required