@netlify/edge-bundler 4.3.1 → 4.3.2
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.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
interface BundleErrorOptions {
|
|
2
2
|
format: string;
|
|
3
3
|
}
|
|
4
|
-
declare const getCustomErrorInfo: (options
|
|
4
|
+
declare const getCustomErrorInfo: (options?: BundleErrorOptions) => {
|
|
5
5
|
location: {
|
|
6
|
-
format: string;
|
|
6
|
+
format: string | undefined;
|
|
7
7
|
runtime: string;
|
|
8
8
|
};
|
|
9
9
|
type: string;
|
|
10
10
|
};
|
|
11
11
|
declare class BundleError extends Error {
|
|
12
12
|
customErrorInfo: ReturnType<typeof getCustomErrorInfo>;
|
|
13
|
-
constructor(originalError: Error, options
|
|
13
|
+
constructor(originalError: Error, options?: BundleErrorOptions);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* BundleErrors are treated as user-error, so Netlify Team is not alerted about them.
|
|
17
17
|
*/
|
|
18
|
-
declare const wrapBundleError: (input: unknown, options
|
|
18
|
+
declare const wrapBundleError: (input: unknown, options?: BundleErrorOptions) => unknown;
|
|
19
19
|
export { BundleError, wrapBundleError };
|
package/dist/node/config.js
CHANGED
|
@@ -2,6 +2,7 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { pathToFileURL } from 'url';
|
|
4
4
|
import tmp from 'tmp-promise';
|
|
5
|
+
import { BundleError } from './bundle_error.js';
|
|
5
6
|
import { getPackagePath } from './package_json.js';
|
|
6
7
|
var ConfigExitCode;
|
|
7
8
|
(function (ConfigExitCode) {
|
|
@@ -84,7 +85,7 @@ const logConfigError = (func, exitCode, stderr, log) => {
|
|
|
84
85
|
log.user(`'config' function in edge function at '${func.path}' must return an object with primitive values only`);
|
|
85
86
|
break;
|
|
86
87
|
case ConfigExitCode.InvalidDefaultExport:
|
|
87
|
-
throw new Error(`Default export in '${func.path}' must be a function. More on the Edge Functions API at https://ntl.fyi/edge-api.`);
|
|
88
|
+
throw new BundleError(new Error(`Default export in '${func.path}' must be a function. More on the Edge Functions API at https://ntl.fyi/edge-api.`));
|
|
88
89
|
default:
|
|
89
90
|
log.user(`Could not load configuration for edge function at '${func.path}'`);
|
|
90
91
|
log.user(stderr);
|