1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/PettingZoo.Core/Validation/IPayloadValidator.cs

26 lines
529 B
C#
Raw Permalink Normal View History

using System;
namespace PettingZoo.Core.Validation
{
public class PayloadValidationException : Exception
{
public TextPosition? ErrorPosition { get; }
public PayloadValidationException(string message, TextPosition? errorPosition) : base(message)
{
ErrorPosition = errorPosition;
}
}
public interface IPayloadValidator
{
bool CanValidate();
/// <exception cref="PayloadValidationException" />
void Validate(string payload);
}
}