UNPKG

snyk-mvn-plugin

Version:
32 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DependencyTreeError = void 0; /** * Helper function to ensure we have an Error object */ function ensureError(error) { if (error instanceof Error) { return error; } return new Error(String(error)); } class DependencyTreeError extends Error { command; args; originalError; constructor(command, args, originalError) { const error = ensureError(originalError); // We don't actually use the message, but Error requires one super('Maven dependency tree execution failed'); this.name = 'DependencyTreeError'; this.command = command; this.args = args; this.originalError = error; // Maintains proper stack trace for where our error was thrown (only available on V8) if (Error.captureStackTrace) { Error.captureStackTrace(this, DependencyTreeError); } } } exports.DependencyTreeError = DependencyTreeError; //# sourceMappingURL=errors.js.map