Answer the question
In order to leave comments, you need to log in
How to correctly render errors on node js with Backbone?
And so, my example.
Trying to render a model/collection using fetch
var usersCollection = new UsersCollection
usersCollection.fetch({
success: function(data, res, options){
console.log('Res is ' , res)
}
,
error: function(data, res, options){
console.log('Error ', res )
}
})
usersRouter.route('/')
.get(function(req, res, next) {
var err = new Error(
this.message = 'Some error')
next(err)
})
app.use(function(err, req, res, next){
console.log( err)
// res.send(err)
res.render('ErrorView', err)
})
error: function(data, res, options){
console.log('Error ', res )
}
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question