/**
 * Copyright © 2024 Nevis Security AG. All rights reserved.
 */

import { PasswordEnrollmentError } from './PasswordEnrollmentError';

/**
 * The provided password has failed the validation done in {@link PasswordPolicy.validatePasswordForEnrollment}.
 *
 * @group Errors
 * @category Password Enrollment
 */
export class PasswordEnrollmentCustomValidationError extends PasswordEnrollmentError {
	/**
	 * Provides details about the error that occurred.
	 */
	description: string;

	/**
	 * The exception (if any) that caused this error.
	 */
	cause?: string;

	/**
	 * The default constructor.
	 *
	 * @param description provides details about the error that occurred.
	 * @param cause the exception (if any) that caused this error.
	 */
	constructor(description: string, cause?: string) {
		super();
		this.description = description;
		this.cause = cause;
	}
}
