Skip to content

Commit eef80eb

Browse files
committed
keyword: Check response status instead of payload
1 parent aa20fe1 commit eef80eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/routes/keyword.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { NotFoundError } from '@ember-data/adapter/error';
12
import Route from '@ember/routing/route';
23
import { inject as service } from '@ember/service';
34

@@ -8,7 +9,7 @@ export default Route.extend({
89
try {
910
return await this.store.find('keyword', keyword_id);
1011
} catch (e) {
11-
if (e.errors.some(e => e.detail === 'Not Found')) {
12+
if (e instanceof NotFoundError) {
1213
this.flashMessages.queue(`Keyword '${keyword_id}' does not exist`);
1314
return this.replaceWith('index');
1415
}

0 commit comments

Comments
 (0)