2021-04-29 20:00:59 +00:00
|
|
|
import Watchable from './watchable';
|
2017-10-23 17:17:22 +00:00
|
|
|
import codesForError from '../utils/codes-for-error';
|
|
|
|
|
2021-04-29 20:00:59 +00:00
|
|
|
export default class NamespaceAdapter extends Watchable {
|
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
|
|
|
}
|
|
|
|
}
|