react-router icon indicating copy to clipboard operation
react-router copied to clipboard

Attaching some error handling

Open jsdf opened this issue 12 years ago • 3 comments

Where can I attach some error handling?

Any errors which occur during the initial render of a view which I've just navigated to end up getting caught and rethrown by Routes.statics.handleAsyncError.

This alerts me to the error (which is okay in development) but I can't see where I might attach my own handling to it.

jsdf avatar Jul 31 '14 01:07 jsdf

I've got some better error handling going on the routes-props branch, but there are a few failing tests to work out still. I'm fairly sure that nothing is wrong with the code, just something up with our test harness... :/

Anyway, once that's merged you'll be able to do stuff like this:

<Routes onTransitionError={myErrorHandler}>
  ...
</Routes>

mjackson avatar Jul 31 '14 04:07 mjackson

Cool, that's exactly what I was looking for.

jsdf avatar Aug 04 '14 02:08 jsdf

closing, please follow #152

ryanflorence avatar Aug 06 '14 16:08 ryanflorence