using System;
using System.Collections.Generic;

namespace StellaOps.Feedser.Source.Common.Xml;

public sealed class XmlSchemaValidationException : Exception
{
    public XmlSchemaValidationException(string documentName, IReadOnlyList<XmlSchemaValidationError> errors)
        : base($"XML schema validation failed for '{documentName}'.")
    {
        DocumentName = documentName;
        Errors = errors ?? Array.Empty<XmlSchemaValidationError>();
    }

    public string DocumentName { get; }

    public IReadOnlyList<XmlSchemaValidationError> Errors { get; }
}
