using System;
namespace VersOne.Epub
{
///
/// Represents a base class for exceptions thrown by the EpubReader due to a schema parsing error.
///
public abstract class EpubSchemaException : EpubReaderException
{
///
/// Initializes a new instance of the class with a specified schema file type.
///
/// The type of the schema file that caused the error.
protected EpubSchemaException(EpubSchemaFileType schemaFileType)
{
SchemaFileType = schemaFileType;
}
///
/// Initializes a new instance of the class with a specified error and a specified schema file type.
///
/// The message that describes the error.
/// The type of the schema file that caused the error.
protected EpubSchemaException(string message, EpubSchemaFileType schemaFileType)
: base(message)
{
SchemaFileType = schemaFileType;
}
///
/// Initializes a new instance of the class with a specified error message, a reference to the inner exception
/// that is the cause of this exception, and a specified schema file type.
///
/// The error message that explains the reason for the exception.
/// The exception that is the cause of the current exception, or a null reference if no inner exception is specified.
/// The type of the schema file that caused the error.
protected EpubSchemaException(string message, Exception? innerException, EpubSchemaFileType schemaFileType)
: base(message, innerException)
{
SchemaFileType = schemaFileType;
}
///
/// Gets the type of the schema file that caused the error.
///
public EpubSchemaFileType SchemaFileType { get; }
}
}