internal ValidationEventArgs(JsonSchemaException ex)
 {
     ValidationUtils.ArgumentNotNull(ex, "ex");
     _ex = ex;
 }
 private void OnValidationEvent(JsonSchemaException exception)
 {
     ValidationEventHandler handler = ValidationEventHandler;
     if (handler != null)
         handler(this, new ValidationEventArgs(exception));
     else
         throw exception;
 }
Пример #3
0
 internal ValidationEventArgs(JsonSchemaException ex)
 {
     ValidationUtils.ArgumentNotNull(ex, "ex");
     _ex = ex;
 }
        private void RaiseError(string message, SchemaReport report)
        {
            IJsonLineInfo lineInfo = this;

            string exceptionMessage = (lineInfo.HasLineInfo())
                ? message + " Line {0}, position {1}.".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition)
                : message;

            JsonSchemaException ex = new JsonSchemaException(exceptionMessage, null, Path, lineInfo.LineNumber, lineInfo.LinePosition);

            if (report != null && report.Messages != null)
                report.Messages.Add(ex);
            else
                OnValidationEvent(ex);
        }