1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.ArgumentError = void 0;
|
4 | const wrapStackTrace = (error, stack) => `${error.name}: ${error.message}\n${stack}`;
|
5 |
|
6 |
|
7 |
|
8 | class 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 | }
|
27 | exports.ArgumentError = ArgumentError;
|