~/talk

Error Handling in Node.js

Talkat MountainWest JavaScript 2014 · on Friday, 2014-03-21· [nodejs, security]
slides:none on file

Practical rules and concrete code: use Express middleware and the Callback pattern everywhere, use error objects not strings so stack traces travel, wrap JSON.parse in try catch, build custom error classes that carry metadata and i18n via the Kraken Babel-style getMessage, log and aggregate client and server errors, normalize responses with a single response handler, call next(err) and return from middleware, and on process.on('uncaughtException') always process.exit after logging to avoid leaked connections.

AI-written summary · about

  1. 0:00Start
  2. 7:30Best Practices for Handling Errors
  3. 8:48Try Catch
  4. 9:42Callback Pattern
  5. 11:57Creating Custom Error Objects
  6. 12:37Custom Errors
  7. 13:38Conventions
  8. 14:02Deal with Error Objects
  9. 16:13Helper Function
  10. 19:07Basic Error Handler
  11. 20:23Custom Error Objects
  12. 21:18Error Handler
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.