A Node process is a single, long-lived program serving thousands of requests. One rejected promise nobody catches does not fail a request — it kills the process, and with it every other request in flight. That makes error handling on the server a different discipline from error handling in the browser, where a thrown exception loses one click.
Logging is the other half of the same job. When the process falls over at 3 a.m., the only evidence is what it wrote to stdout before it died, and Error: failed is worthless next to a JSON object carrying the request id, the error code and a stack.
What follows covers what a Node error contains, how to give it a cause and a code, how to make a crash deliberate instead of accidental, and how to log structurally with Pino 18,227 . Express 24,430 error middleware and its request logging come in Express.js.