@netlify/build 36.4.3 → 36.4.5
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.
|
@@ -3,6 +3,7 @@ import { inspect } from 'node:util';
|
|
|
3
3
|
import { DEFAULT_API_HOST } from '../../core/normalize_flags.js';
|
|
4
4
|
import { logError } from '../../log/logger.js';
|
|
5
5
|
import { getFileWithMetadata, getKeysToUpload, scanForBlobs } from '../../utils/blobs.js';
|
|
6
|
+
import { getErrorMessage } from '../../utils/errors.js';
|
|
6
7
|
import { getBlobs } from '../../utils/frameworks_api.js';
|
|
7
8
|
const coreStep = async function ({ logs, deployId, buildDir, packagePath, constants: { SITE_ID, NETLIFY_API_TOKEN, NETLIFY_API_HOST }, systemLog, }) {
|
|
8
9
|
// This should never happen due to the condition check
|
|
@@ -58,14 +59,15 @@ const coreStep = async function ({ logs, deployId, buildDir, packagePath, consta
|
|
|
58
59
|
}));
|
|
59
60
|
}
|
|
60
61
|
catch (err) {
|
|
61
|
-
|
|
62
|
+
const errorMessage = getErrorMessage(err);
|
|
63
|
+
logError(logs, `Error uploading blobs to deploy store: ${errorMessage}`);
|
|
62
64
|
try {
|
|
63
65
|
systemLog(`Error uploading blobs to deploy store full error: ${inspect(err, { colors: false, compact: true, maxStringLength: Infinity, maxArrayLength: Infinity, depth: Infinity, breakLength: Infinity })}`);
|
|
64
66
|
}
|
|
65
67
|
catch {
|
|
66
68
|
// systemLog is meant for debugging purposes, we should not ever throw if it fails
|
|
67
69
|
}
|
|
68
|
-
throw new Error(`Failed while uploading blobs to deploy store
|
|
70
|
+
throw new Error(`Failed while uploading blobs to deploy store: ${errorMessage}`, { cause: err });
|
|
69
71
|
}
|
|
70
72
|
systemLog(`Done uploading blobs to deploy store.`);
|
|
71
73
|
return {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getDeployStore } from '@netlify/blobs';
|
|
2
2
|
import { log, logError } from '../../log/logger.js';
|
|
3
3
|
import { getFileWithMetadata, getKeysToUpload, scanForBlobs } from '../../utils/blobs.js';
|
|
4
|
+
import { getErrorMessage } from '../../utils/errors.js';
|
|
4
5
|
import { getBlobs } from '../../utils/frameworks_api.js';
|
|
5
6
|
const coreStep = async function ({ debug, logs, deployId, buildDir, quiet, packagePath, constants: { SITE_ID, NETLIFY_API_TOKEN, NETLIFY_API_HOST }, }) {
|
|
6
7
|
// This should never happen due to the condition check
|
|
@@ -65,8 +66,9 @@ const coreStep = async function ({ debug, logs, deployId, buildDir, quiet, packa
|
|
|
65
66
|
}));
|
|
66
67
|
}
|
|
67
68
|
catch (err) {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
const errorMessage = getErrorMessage(err);
|
|
70
|
+
logError(logs, `Error uploading blobs to deploy store: ${errorMessage}`);
|
|
71
|
+
throw new Error(`Failed while uploading blobs to deploy store: ${errorMessage}`, { cause: err });
|
|
70
72
|
}
|
|
71
73
|
if (!quiet) {
|
|
72
74
|
log(logs, `Done uploading blobs to deploy store.`);
|
package/lib/utils/errors.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely extracts a message from a caught value that isn't guaranteed to be an `Error`.
|
|
3
|
+
*/
|
|
4
|
+
export declare const getErrorMessage: (error: unknown) => string;
|
|
1
5
|
type asyncFunction<T> = (...args: unknown[]) => Promise<T>;
|
|
2
6
|
/**
|
|
3
7
|
* Wrap an async function so it prepends an error message on exceptions.
|
package/lib/utils/errors.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely extracts a message from a caught value that isn't guaranteed to be an `Error`.
|
|
3
|
+
*/
|
|
4
|
+
export const getErrorMessage = (error) => {
|
|
5
|
+
try {
|
|
6
|
+
return error instanceof Error ? error.message : (error?.toString() ?? 'unknown error');
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return 'unknown error';
|
|
10
|
+
}
|
|
11
|
+
};
|
|
1
12
|
/**
|
|
2
13
|
* Wrap an async function so it prepends an error message on exceptions.
|
|
3
14
|
* This helps locate errors.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "36.4.
|
|
3
|
+
"version": "36.4.5",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
"@netlify/cache-utils": "^7.1.2",
|
|
72
72
|
"@netlify/config": "^25.2.3",
|
|
73
73
|
"@netlify/edge-bundler": "16.0.4",
|
|
74
|
-
"@netlify/functions-utils": "^7.1.
|
|
74
|
+
"@netlify/functions-utils": "^7.1.8",
|
|
75
75
|
"@netlify/git-utils": "^7.1.1",
|
|
76
76
|
"@netlify/opentelemetry-utils": "^3.1.0",
|
|
77
77
|
"@netlify/plugins-list": "^6.81.6",
|
|
78
78
|
"@netlify/run-utils": "^7.1.0",
|
|
79
|
-
"@netlify/zip-it-and-ship-it": "15.
|
|
79
|
+
"@netlify/zip-it-and-ship-it": "15.5.0",
|
|
80
80
|
"@sindresorhus/slugify": "^2.0.0",
|
|
81
81
|
"ansis": "^4.1.0",
|
|
82
82
|
"execa": "^8.0.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"rfdc": "^1.3.0",
|
|
102
102
|
"safe-json-stringify": "^1.2.0",
|
|
103
103
|
"semver": "^7.3.8",
|
|
104
|
-
"supports-color": "^
|
|
104
|
+
"supports-color": "^11.0.0",
|
|
105
105
|
"terminal-link": "^4.0.0",
|
|
106
106
|
"ts-node": "^10.9.1",
|
|
107
107
|
"typescript": "^5.0.0",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"engines": {
|
|
144
144
|
"node": ">=22.12.0"
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "eb8d444187fbde398eb9287cf109ef04be9ec5de"
|
|
147
147
|
}
|