UNPKG

823 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.ArgumentError = void 0;
4const wrapStackTrace = (error, stack) => `${error.name}: ${error.message}\n${stack}`;
5/**
6@hidden
7*/
8class ArgumentError extends Error {
9 constructor(message, context, stack, errors = new Map()) {
10 super(message);
11 Object.defineProperty(this, "validationErrors", {
12 enumerable: true,
13 configurable: true,
14 writable: true,
15 value: void 0
16 });
17 this.name = 'ArgumentError';
18 if (Error.captureStackTrace) {
19 Error.captureStackTrace(this, context);
20 }
21 else {
22 this.stack = wrapStackTrace(this, stack);
23 }
24 this.validationErrors = errors;
25 }
26}
27exports.ArgumentError = ArgumentError;