github.com/hernad/nomad@v1.6.112/ui/app/adapters/namespace.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import Watchable from './watchable'; 7 import codesForError from '../utils/codes-for-error'; 8 import classic from 'ember-classic-decorator'; 9 10 @classic 11 export default class NamespaceAdapter extends Watchable { 12 findRecord(store, modelClass, id) { 13 return super.findRecord(...arguments).catch((error) => { 14 const errorCodes = codesForError(error); 15 if (errorCodes.includes('501')) { 16 return { Name: id }; 17 } 18 }); 19 } 20 }