keystone-classic icon indicating copy to clipboard operation
keystone-classic copied to clipboard

Default render function does not handle upstream error

Open mahnunchik opened this issue 8 years ago • 1 comments

Steps to reproduce the actual/current behavior

module.exports = function create(req, res) {
  const view = new keystone.View(req, res);

  view.on('init', (next) => {
    next(new Error('Unhandled error'));
  });
  
  view.render('index');
};

Error: https://github.com/keystonejs/keystone/blob/v0.3.21/lib/view.js#L372 Handler: https://github.com/keystonejs/keystone/blob/v0.3.21/lib/view.js#L333

Environment

Software Version
Keystone from 0.3 to 4

mahnunchik avatar Apr 28 '17 12:04 mahnunchik

May I know any update on this bug? There are a few example code using next(err) which doesn't fire any handler. Please fix it as soon as possible.

georgezhang avatar Jul 29 '19 17:07 georgezhang