Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 6. Error Handling

In this chapter, we will learn how to handle errors in the Express applications. More specifically, the following topics will be covered:

  • Error categories—runtime and programmer errors

  • Synchronous, asynchronous, and eventful errors

  • Writing a custom Express error handler

  • Return errors, not strings

  • Handling uncaught exceptions

  • Longer stack traces

Most of these topics not only apply to the Express applications but also to the Node applications in general, so try not to skim through this chapter. To make it more interesting, we will be creating a Wall microblogging application (from scratch), where people can publish posts and be notified in real time about the updates.