INNER CODE UNIT · TypeScript

ArgumentError

sindresorhus/ow · source/argument-error.ts:8

export class ArgumentError extends Error {
	readonly validationErrors: ReadonlyMap<string, Set<string>>;

	constructor(message: string, context: Function, errors = new Map<string, Set<string>>()) {
		super(message);

		this.name = 'ArgumentError';

		if (Error.captureStackTrace) {
			Error.captureStackTrace(this, context);
		} else {
			this.stack = wrapStackTrace(this, generateStackTrace());
		}

		this.validationErrors = errors;
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…