Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

error handling in node js

app.get('/', function (req, res, next) {
  Promise.resolve().then(function () {
    throw new Error('BROKEN')
  }).catch(next) // Errors will be passed to Express.
})
Source by expressjs.com #
 
PREVIOUS NEXT
Tagged: #error #handling #node #js
ADD COMMENT
Topic
Name
8+8 =