We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0a676f commit 5c3547dCopy full SHA for 5c3547d
app/routes/category.js
@@ -1,3 +1,4 @@
1
+import { NotFoundError } from '@ember-data/adapter/error';
2
import Route from '@ember/routing/route';
3
import { inject as service } from '@ember/service';
4
@@ -8,7 +9,7 @@ export default Route.extend({
8
9
try {
10
return await this.store.find('category', params.category_id);
11
} catch (e) {
- if (e.errors.some(e => e.detail === 'Not Found')) {
12
+ if (e instanceof NotFoundError) {
13
this.flashMessages.queue(`Category '${params.category_id}' does not exist`);
14
return this.replaceWith('index');
15
}
0 commit comments