Skip to content

Commit ce54696

Browse files
author
Jake Goldsborough
committed
making ember return an error but not redirect if crate not found
1 parent cfd6091 commit ce54696

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/routes/crate.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ export default Ember.Route.extend({
44
model(params) {
55
return this.store.find('crate', params.crate_id).catch(e => {
66
if (e.errors.any(e => e.detail === 'Not Found')) {
7-
this.controllerFor('application').set('nextFlashError', `Crate '${params.crate_id}' does not exist`);
8-
return this.replaceWith('index');
7+
throw new Error(`${params.crate_id} not found`);
98
}
109
});
11-
},
10+
}
1211
});

app/templates/crate/version.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,5 @@
244244
</div>
245245
</div>
246246
{{/if}}
247+
248+
{{ outlet }}

0 commit comments

Comments
 (0)