private void OnValidationEvent(JsonSchemaException exception) { ValidationEventHandler handler = ValidationEventHandler; if (handler != null) handler(this, new ValidationEventArgs(exception)); else throw exception; }
private void OnValidationEvent(JsonSchemaException exception) { Newtonsoft.Json.Schema.ValidationEventHandler validationEventHandler = this.ValidationEventHandler; if (validationEventHandler == null) { throw exception; } validationEventHandler((object)this, new ValidationEventArgs(exception)); }
private void method_17(JsonSchemaException jsonSchemaException_0) { Newtonsoft.Json.Schema.ValidationEventHandler handler = this.validationEventHandler_0; if (handler == null) { throw jsonSchemaException_0; } handler(this, new ValidationEventArgs(jsonSchemaException_0)); }
private void OnValidationEvent(JsonSchemaException exception) { ValidationEventHandler validationEventHandler = this.ValidationEventHandler; if (validationEventHandler == null) { throw exception; } validationEventHandler(this, new ValidationEventArgs(exception)); }
public void JsonSchemaException() { JsonSchemaException exception = new JsonSchemaException(); Assert.AreEqual("Exception of type 'BESSy.Json.Schema.JsonSchemaException' was thrown.", exception.Message); exception = new JsonSchemaException("Message!"); Assert.AreEqual("Message!", exception.Message); Assert.AreEqual(null, exception.InnerException); exception = new JsonSchemaException("Message!", new Exception("Inner!")); Assert.AreEqual("Message!", exception.Message); Assert.AreEqual("Inner!", exception.InnerException.Message); }
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); }