/// <summary>
 /// Initializes a new instance of the <see cref="UnhandledExceptionEvent"/> class.
 /// </summary>
 /// <param name="e">The unhandled exception to wrap.</param>
 public UnhandledExceptionEvent( Exception e )
 {
     if( e.NotNullReference() )
         this.exception = e;
     else
         this.exception = new ArgumentNullException("e").StoreFileLine();
 }
        /// <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);
                }
            }
        }