chore: reporting

This commit is contained in:
cha0s 2021-02-02 15:17:00 -06:00
parent eb3608cf6f
commit 8ea88a0af5

View File

@ -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}`);
}
}