标准消息取消Error标识位; Api层统一使用Code标识错误码,Tcp/Udp 测试通过
大石头X2 authored at 2017-01-12 12:05:06
772.00 B
X
using System;

namespace NewLife.Remoting
{
    /// <summary>远程调用异常</summary>
    public class ApiException : Exception
    {
        /// <summary>代码</summary>
        public Int32 Code { get; set; }

        /// <summary>实例化远程调用异常</summary>
        /// <param name="code"></param>
        /// <param name="message"></param>
        public ApiException(Int32 code, String message) : base(message)
        {
            Code = code;
        }

        /// <summary>实例化远程调用异常</summary>
        /// <param name="code"></param>
        /// <param name="ex"></param>
        public ApiException(Int32 code, Exception ex) : base(ex.Message, ex)
        {
            Code = code;
        }
    }
}