mod-build 4.0.106-beta.2 → 4.0.106-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.106-beta.2",
3
+ "version": "4.0.106-beta.3",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -107,17 +107,15 @@ async function downloadImage(url) {
107
107
  const fileUrl = `https://${defaultSettings.nodeEnv}/quote/resources/assets/${url}`
108
108
  const response = await fetch(fileUrl);
109
109
  if (!response.ok) {
110
- console.error(`Error downloading image ${url}: ${response.statusText}`);
111
- throw new Error(`Error downloading image ${url}: ${response.statusText}`);
110
+ throw new Error(`Error downloading image ${fileUrl}: ${response.statusText}`);
112
111
  }
113
112
  const buffer = Buffer.from(await response.arrayBuffer());
114
113
  fs.mkdirSync(path.dirname(imagePath), { recursive: true });
115
114
  fs.writeFileSync(imagePath, buffer);
116
- console.log(`Downloaded image ${url}`);
115
+ console.log(`Downloaded image ${fileUrl}`);
117
116
  return imagePath;
118
117
  } catch (error) {
119
- console.error(`Error downloading image ${url}: ${error}`);
120
- throw new Error(`Error downloading image ${url}: ${error}`);
118
+ throw new Error(`Error downloading image ${fileUrl}: ${error}`);
121
119
  }
122
120
  }
123
121