Pull requests

#10 Declined
Repository
rodogu rodogu
Branch
ac-797
Repository
atlassian atlassian
Branch
master

AC-797 redirecting to error page if there are errors in middleware

Author
  1. Roberto Dominguez
Reviewers
Description

just need to define errorPage in your config.json and any error in the middleware will be redirected there

Comments (4)

  1. Rich Manalang [Atlassian]

    I'm having second thoughts about this because:

    1. It only handles OAuth mw errors. Setting the errorPage prop in the config.json is misleading in that it appears to be a general error page.
    2. Even after setting the errorPage property, you still have to define a route that handles that. I suppose we can automatically configure this.

    What if we created a generic error handler much higher up in the stack so that we can use it in other places?

    1. Roberto Dominguez author

      Yeah, good idea on making a more generic one and creating a default handler... however:

      • You may want to do more than just redirecting. In our app, we actually send a hipchat message when something goes wrong
      • I can see the error page even being a static page...

      But I agree, it'd be a good idea moving an error page higher in the page. Doing something else when an error happen could be handled with an event handler