using System;
|
|
namespace Bro.Common.Helper
|
{
|
public enum ExceptionLevel
|
{
|
Info = 0,
|
Warning = 1,
|
Fatal = 2,
|
}
|
|
//public delegate void OnProcessExceptionRaisedDelegate(DateTime dt, ProcessException ex);
|
//[Serializable]
|
public class ProcessException : Exception
|
{
|
//public static event OnProcessExceptionRaisedDelegate OnProcessExceptionRaised;
|
|
public ExceptionLevel Level { get; set; } = ExceptionLevel.Warning;
|
|
public ProcessException()
|
{
|
}
|
|
public ProcessException(Exception ex, ExceptionLevel lvl = ExceptionLevel.Warning) : base(ex.Message, ex)
|
{
|
Level = lvl;
|
ExceptionNotice();
|
}
|
|
public ProcessException(string error, Exception ex = null, ExceptionLevel lvl = ExceptionLevel.Warning) : base(error, ex)
|
{
|
Level = lvl;
|
ExceptionNotice();
|
}
|
|
public void ExceptionNotice()
|
{
|
//OnProcessExceptionRaised?.Invoke(DateTime.Now, this);
|
}
|
}
|
|
public class AuthorityException : ProcessException
|
{
|
}
|
}
|