/// <summary> /// Stores debug information about the current state of the reader, into the specified <see cref="Exception"/>. /// </summary> /// <param name="exception">The exception to store the state of the reader in.</param> public virtual void StorePosition( Exception exception ) { // NOTE: we don't throw any exceptions from here, in case this property is used to store as some exception's data if( exception.NotNullReference() ) { exception.Store("Token", this.Token); exception.Store("Name", this.Name); // prevent stack overflow (these properties throw exceptions) if( this.Token != DataStoreToken.DataStoreStart || this.Token != DataStoreToken.DataStoreEnd ) { exception.Store("Depth", this.Depth); exception.Store("Path", this.Path); } } }
/// <summary> /// Stores debug information about the current state of the reader, into the specified <see cref="Exception"/>. /// </summary> /// <param name="exception">The exception to store the state of the reader in.</param> public override void StorePosition( Exception exception ) { base.StorePosition(exception); var lineInfo = this.xmlReader as IXmlLineInfo; if( lineInfo.NotNullReference() && lineInfo.HasLineInfo() ) { exception.Store("XmlLine", lineInfo.LineNumber); exception.Store("XmlColumn", lineInfo.LinePosition); } }
/// <summary> /// Stores debug information about the current state of the reader, into the specified <see cref="Exception"/>. /// </summary> /// <param name="exception">The exception to store the state of the reader in.</param> public override void StorePosition( Exception exception ) { base.StorePosition(exception); try { exception.Store("JsonLine", this.jsonReader.LineNumber); exception.Store("JsonColumn", this.jsonReader.ColumnNumber); } catch { } }