Skip to content

Commit 78f2227

Browse files
author
Jake Goldsborough
committed
making app use flash error and adding error substate template to ember
1 parent ce54696 commit 78f2227

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

app/routes/crate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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-
throw new Error(`${params.crate_id} not found`);
7+
return this.controllerFor('application').set('flashError', `Crate '${params.crate_id}' does not exist`);
88
}
99
});
1010
}

app/templates/crate/error.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ title 'Crate Not Found' }}

app/templates/crate/version.hbs

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

0 commit comments

Comments
 (0)