diff --git a/ui/app/adapters/allocation.js b/ui/app/adapters/allocation.js index 20cca3c29dd5..3fcfb6128d89 100644 --- a/ui/app/adapters/allocation.js +++ b/ui/app/adapters/allocation.js @@ -31,14 +31,8 @@ async function handleFSResponse(response) { } else { const body = await response.text(); - // TODO update this if/when endpoint returns 404 as expected - const statusIs500 = response.status === 500; - const bodyIncludes404Text = body.includes('no such file or directory'); - - const translatedCode = statusIs500 && bodyIncludes404Text ? 404 : response.status; - throw { - code: translatedCode, + code: response.status, toString: () => body, }; } diff --git a/ui/tests/acceptance/behaviors/fs.js b/ui/tests/acceptance/behaviors/fs.js index 114078261f65..1e2574c0eb01 100644 --- a/ui/tests/acceptance/behaviors/fs.js +++ b/ui/tests/acceptance/behaviors/fs.js @@ -361,7 +361,8 @@ export default function browseFilesystem({ ...visitSegments({ allocation: this.allocation, task: this.task }), path: '/what-is-this', }); - assert.equal(FS.error.title, 'Not Found', '500 is interpreted as 404'); + assert.notEqual(FS.error.title, 'Not Found', '500 is not interpreted as 404'); + assert.equal(FS.error.title, 'Server Error', '500 is not interpreted as 500'); await visit('/');