// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) by respective owners including Yahoo!, Microsoft, and // individual contributors. All rights reserved. Released under a BSD // license as described in the file LICENSE. // // -------------------------------------------------------------------------------------------------------------------- using Newtonsoft.Json; using System; namespace VW.Serializer { /// /// Exception thrown if fails to deserialize the JSON. /// [Serializable] public sealed class VowpalWabbitJsonException : Exception { /// /// Initializes a new instance of the class. /// /// The reader used at deserialization time. /// The message that describes the error. public VowpalWabbitJsonException(JsonReader reader, string message) : base(message) { this.Path = reader.Path; var lineInfo = reader as IJsonLineInfo; if (lineInfo != null) { this.LineNumber = lineInfo.LineNumber; this.LinePosition = lineInfo.LinePosition; } } /// /// The line number at which this error happened. /// public int LineNumber { get; private set; } /// /// The character position at which this error happened. /// public int LinePosition { get; private set; } /// /// The path as returned by . /// public string Path { get; private set; } } }