diff --git a/packages/resource/src/resource.js b/packages/resource/src/resource.js index a9e074f..6d3caf8 100644 --- a/packages/resource/src/resource.js +++ b/packages/resource/src/resource.js @@ -30,6 +30,9 @@ export default class Resource extends decorate(Class) { try { if ('client' === process.env.SIDE) { const response = await fetch(join('/', this.root, uri)); + if (!response.ok) { + throw new Error('Not found'); + } return response.arrayBuffer(); } return await new Promise((resolve, reject) => { @@ -45,7 +48,7 @@ export default class Resource extends decorate(Class) { }); } catch (error) { - throw new Error(`Error reading ${JSON.stringify(uri)}: ${error.message}`); + throw new Error(`Resource: ${JSON.stringify(uri)}: ${error.message}`); } }