using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Song.ViewData { /// /// 异常处理 /// public class VExcept : System.Exception { /// /// 状态码 /// public int State { get; set; } private VExcept(string message, int state) : base(message) { this.State = state; } /// /// 校验类,实始状态码为10000 /// /// /// /// public static VExcept Verify(string msg, int state) { VExcept we = new VExcept(msg, state); we.State = 1000 + state; return we; } /// /// 系统类错误 /// /// /// /// public static VExcept System(string msg, int state) { return new VExcept(msg, 9000 + state); } } }