﻿using System;

namespace JinianNet.TengSnake
{
    /// <summary>
    /// 异常上下文
    /// </summary>
    public class ExceptionContext
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public ExceptionContext()
            : this(null)
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="exception">异常</param>
        public ExceptionContext(Exception exception)
        {
            this.Exception = exception;
        }

        /// <summary>
        /// 当前异常
        /// </summary>
        public Exception Exception
        {
            get;
            set;
        }

        /// <summary>
        /// 当异常处理后需要返回的结果
        /// </summary>
        public object Result { get; set; }

        /// <summary>
        /// 异常是否已经处理
        /// </summary>
        public bool ExceptionHandled{ get; set; }
    }
}
