namespace StellaOps.Feedser.Source.Common.Json;

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

    public string DocumentName { get; }

    public IReadOnlyList<JsonSchemaValidationError> Errors { get; }
}
