@netlify/zip-it-and-ship-it
Version:
18 lines (17 loc) • 616 B
JavaScript
export class FunctionBundlingUserError extends Error {
constructor(message, customErrorInfo) {
super(message);
Object.setPrototypeOf(this, new.target.prototype);
this.name = 'FunctionBundlingUserError';
Error.captureStackTrace(this, FunctionBundlingUserError);
FunctionBundlingUserError.addCustomErrorInfo(this, customErrorInfo);
}
static addCustomErrorInfo(error, customErrorInfo) {
const info = {
type: 'functionsBundling',
location: customErrorInfo,
};
error.customErrorInfo = info;
return error;
}
}