diff --git a/packages/jsapi-nodejs/src/serverUtils.ts b/packages/jsapi-nodejs/src/serverUtils.ts index 8aae9c2bc3..f7c89fe1b9 100644 --- a/packages/jsapi-nodejs/src/serverUtils.ts +++ b/packages/jsapi-nodejs/src/serverUtils.ts @@ -45,6 +45,11 @@ export async function downloadFromURL( }); res.on('end', async () => { + if (res.statusCode === 404) { + reject(new Error(`File not found: "${url}"`)); + return; + } + resolve(file); }); })