@rg-dev/stdlib 1.0.14 → 1.0.16

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.
@@ -6083,8 +6083,14 @@ function downloadFile(url, destination, headers) {
6083
6083
  try {
6084
6084
  const fetcher = await getFetch();
6085
6085
  const response = await fetcher(url, { headers: { ...headers || {} } });
6086
- if (!response.ok)
6087
- throw new Error("Error downloading file");
6086
+ if (!response.ok) {
6087
+ let error = "";
6088
+ try {
6089
+ error = await (response == null ? void 0 : response.text());
6090
+ } catch (e2) {
6091
+ }
6092
+ throw new Error(`Error downloading file ${error || "status code: " + response.status}`);
6093
+ }
6088
6094
  const dest = fs2.createWriteStream(destination);
6089
6095
  const body = response.body;
6090
6096
  if (body["pipe"]) {
@@ -6084,8 +6084,14 @@ function downloadFile(url, destination, headers) {
6084
6084
  try {
6085
6085
  const fetcher = await getFetch();
6086
6086
  const response = await fetcher(url, { headers: { ...headers || {} } });
6087
- if (!response.ok)
6088
- throw new Error("Error downloading file");
6087
+ if (!response.ok) {
6088
+ let error = "";
6089
+ try {
6090
+ error = await (response == null ? void 0 : response.text());
6091
+ } catch (e2) {
6092
+ }
6093
+ throw new Error(`Error downloading file ${error || "status code: " + response.status}`);
6094
+ }
6089
6095
  const dest = fs2.createWriteStream(destination);
6090
6096
  const body = response.body;
6091
6097
  if (body["pipe"]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rg-dev/stdlib",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",