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 aa20fe1 commit eef80ebCopy full SHA for eef80eb
app/routes/keyword.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('keyword', keyword_id);
11
} catch (e) {
- if (e.errors.some(e => e.detail === 'Not Found')) {
12
+ if (e instanceof NotFoundError) {
13
this.flashMessages.queue(`Keyword '${keyword_id}' does not exist`);
14
return this.replaceWith('index');
15
}
0 commit comments