2017-10-23 17:17:22 +00:00
|
|
|
import ApplicationAdapter from './application';
|
|
|
|
import codesForError from '../utils/codes-for-error';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class Namespace extends ApplicationAdapter {
|
2017-10-23 17:17:22 +00:00
|
|
|
findRecord(store, modelClass, id) {
|
2020-06-10 13:49:16 +00:00
|
|
|
return super.findRecord(...arguments).catch(error => {
|
2017-10-23 17:17:22 +00:00
|
|
|
const errorCodes = codesForError(error);
|
|
|
|
if (errorCodes.includes('501')) {
|
|
|
|
return { Name: id };
|
|
|
|
}
|
|
|
|
});
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|