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

import { PendingOutOfBandOperationsError } from './PendingOutOfBandOperationsError';
import { Server } from '../../../localData/Server';

/**
 * The backend does not support the retrieval of out-of-band operations.
 *
 * The backend must be running nevisFIDO 7.2402** or later and the
 * {@link https://docs.nevis.net/nevisfido/reference-guide/uaf-http-api/device-service#get-device-out-of-band-operations | Get Device Out-of-Band Operations}
 * endpoint must be accessible.
 */
export class PendingOutOfBandOperationsOperationNotSupportedByBackendError extends PendingOutOfBandOperationsError {
	/**
	 * Provides details about the error that occurred.
	 */
	description: string;

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

	/**
	 * The server where the error occurred.
	 */
	server: Server;

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