data
data copied to clipboard
review: Request Component Error Handling Improvements
on a completely different note: I've been thinking through some feedback (both explicit and implicit) from @mkszepp RE the <Request /> component. Some unorganized thoughts:
- enforcing error blocks by rethrowing if none is present is good. Throwing in a way that crashes the app is bad.
- we should consider erring sooner (to ensure error block is defined) and potentially a lint rule around ensuring an error block is present
- we should consider a global-ish error capture fallback (I dislike this for a lot of reasons)
- we should consider rethrowing the error async so that it does not crash the app and can be caught by unhandled-exception instrumentation
- we should consider pushing for error boundaries in ember apps so that we can safely throw in templates and allow handling to occur at a point higher up of the application's choosing
- we should consider having a fallback rendered output for the error if no error block is present
fallback would be roughly
<pre error-trace>{{error.message}}\n\n{{error.stack}}</pre>