using System;
namespace SKMC.Api.Common.Exceptions
{
///
/// 基础异常模型
/// 机台运行中可抛出该类型对象或者子类对象
///
public class ExceptionBase : Exception
{
///
/// 内部异常类型
///
public int Type { get; set; }
///
/// 异常码
///
public string Code { get; set; }
///
/// 异常级别
/// 0: 不影响运行的告警
/// 1: 影响不大, 可暂时忽略
/// 2: 影响较大, 需机台暂停并解决完毕后才可继续
/// 4: 影响非常大, 可能伤人或伤设备, 机台告警时流程退出运行
///
public short Level { get; set; }
///
/// 问题点
///
public string Detail { get; set; }
///
/// 异常说明及建议
///
public string Tips { get; set; }
///
/// 异常时的站点Id
///
public int StationId { get; set; }
///
/// 发生时间
///
public DateTime EncounterTime { get; set; }
///
/// 重试动作, 完成重试后需要再次验证
///
public Func RetryAction { get; set; }
///
/// 忽略动作
///
public Action IgnoreAction { get; set; }
///
/// 放弃/退出动作
///
public Action AbortAction { get; set; }
public override string ToString()
{
return $"Code: [{Code}], Type: [{Type}], Level: {Level}, Detail: {Detail}, Message: {Message}, Source: {Source}";
}
}
}