Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for route error substate #134

Closed
rogatty opened this issue Apr 20, 2017 · 3 comments
Closed

Support for route error substate #134

rogatty opened this issue Apr 20, 2017 · 3 comments

Comments

@rogatty
Copy link

rogatty commented Apr 20, 2017

Expected behaviour

When the application route model rejects and the app enters an error substate, FastBoot should render a user-friendly error page and set a desired status code on the response.

Actual behaviour

FastBoot throws an error and renders empty page with status code 503.

Workaround

Enter the error substate manually and prevent bubbling the error up:

routes/application.js

actions: {
  error(err) {
    const fastboot = this.get('fastboot');

    if (fastboot.get('isFastBoot')) {
      fastboot.set('response.statusCode', err.code);
      this.intermediateTransitionTo('application_error', err);
      
      return false;
    }

    return true;
  }
}
@kratiahuja
Copy link
Contributor

Just brainstorming: Can this not be handled in fastboot-app-server or a middleware? FastBoot library is app agnostic. It simply will return the serialized HTML and inject it into the base page.

@rogatty
Copy link
Author

rogatty commented Oct 9, 2017

Might have been fixed by emberjs/ember.js#15689, something to check.

@kratiahuja
Copy link
Contributor

Going to close this as this is fixed in Ember 2.15.1. Please reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants