Description
Currently, when a model hook rejects we bubble up the route hierarchy looking for any route that implements an error
action. If we get to the top (above application route) we have some default behavior for the error
action:
ember.js/packages/@ember/-internals/routing/lib/system/router.ts
Lines 1232 to 1263 in 1b0c903
Which invokes logError
, defined here:
ember.js/packages/@ember/-internals/routing/lib/system/router.ts
Lines 1296 to 1323 in 1b0c903
As you can see, logError
is a small layer on top of console.error
. Unfortunately, this means that any errors during model hooks will not be sent to Ember.onerror
(unless you also implement error
on your application route).
We should fix this by checking if there is an Ember.onerror
and invoking it with the error, falling back to logError
.