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

doing error transition in the redirect hook when class isn't found #262

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

toddjordan
Copy link
Contributor

@toddjordan toddjordan commented Jul 9, 2017

@locks locks temporarily deployed to ember-api-docs-staging-pr-262 July 9, 2017 11:57 Inactive
@toddjordan toddjordan changed the title trying a transition in the error event [WIP]trying a transition in the error event Jul 9, 2017
@toddjordan toddjordan temporarily deployed to ember-api-docs-staging-pr-262 July 9, 2017 12:05 Inactive
@toddjordan toddjordan force-pushed the route-error-handling branch from 8aff7c3 to da4f8c2 Compare July 9, 2017 12:16
@toddjordan toddjordan temporarily deployed to ember-api-docs-staging-pr-262 July 9, 2017 12:17 Inactive
transition to 404 error page from redirect instead of modal hook
@toddjordan toddjordan force-pushed the route-error-handling branch from da4f8c2 to 8c77fce Compare July 9, 2017 21:15
@toddjordan toddjordan changed the title [WIP]trying a transition in the error event doing error transition in the redirect hook when class isn't found Jul 9, 2017
@@ -25,20 +25,27 @@ export default Ember.Route.extend(ScrollTracker, {
find(typeName, param) {
return this.store.find(typeName, param).catch(() => {
return this.store.find('namespace', param).catch(() => {
return this.transitionTo('project-version'); // class doesn't exist in new version
return Ember.RSVP.resolve({ isError: true });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So fastboot gives back a 500 when you transition during the model hook or afterModel hook, so I need to communicate to the redirect hook that I want to send this to our 404 page.

@@ -0,0 +1,10 @@
<article class="whoops">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the same template as error.hbs (without the logic). Open to some design love.

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

Successfully merging this pull request may close these issues.

2 participants