Error thrown during view rendering is supressed and view is re-created
Closed this issue · 3 comments
Howdy. This references this bit of the code - if an error is thrown somewhere within renderViews
(including the View's onRender
handlers), the catch
is triggered, which causes the region.showChildView
or an equivalent to be re-triggered, and also causes the triggered error to not be printed out.
If you can't reproduce this, let me know and I can try to get a base case together for you, it's just moderately annoying to get this set up because it looks like I'll have to provide a basic Webpack setup or something as well. It also looks like most of the cases we had for using load
can be done the same using activate
.
I don't know if you actively maintain this repo or if that bit was intentional for some reason, but I can write up a PR that proxies to transition.error()
if desired.
load
lifecycle was introduced with two differences to activate
:
- Is called in all active routes routes even those that are already activated. See https://github.com/blikblum/marionette.routing/blob/master/test/lifecycle.js#L314
- It will continue the lifecycle even if is rejected. See https://github.com/blikblum/marionette.routing/blob/master/test/lifecycle.js#L325
That being said, i did not foresee errors in render views. This can be fixed by returning loadPromise directly (not tested)
This should be resolved now - could you release this as 1.1.2 on NPM?
Done.
BTW you can take a look at https://github.com/blikblum/nextbone-routing either to migrate to web components or backport to marionette (should be easy). Is based in the more modern slick-router and i remember fixing some bugs that i did not backport.