Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

DeploySharpException 类

The base custom exception class for DeploySharp project. Provides standardized error codes, technical details recording and automatic logging. DeploySharp项目自定义异常基类 提供标准化的错误代码、技术细节记录和自动日志功能

Definition

命名空间: DeploySharp.Common
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public class DeploySharpException : Exception
Inheritance
Object    Exception    DeploySharpException

备注

All custom exceptions in the project should inherit from this class. 项目中所有自定义异常都应继承自此基类。

Automatically logs errors using MyLogger when instantiated. 实例化时会自动通过MyLogger记录错误。

构造函数

DeploySharpException(String) Basic constructor with error message. 基础构造函数(仅错误信息)
DeploySharpException(String, Exception) Constructor with message and inner exception. 包含内部异常的构造函数
DeploySharpException(String, String, String) Full parameter constructor with error code and optional technical details. 完整参数构造函数(包含错误代码和技术细节)
DeploySharpException(String, String, Exception, String) Full parameter constructor with error code, inner exception and optional technical details. 完整参数构造函数(包含错误代码、内部异常和技术细节)

属性

DataGets a collection of key/value pairs that provide additional user-defined information about the exception.
(继承自 Exception。)
ErrorCode Gets the error code following project conventions (e.g. DEPLOY_001 format). 获取遵循项目规范的错误代码(如DEPLOY_001格式)
HelpLinkGets or sets a link to the help file associated with this exception.
(继承自 Exception。)
HResultGets or sets HRESULT, a coded numerical value that is assigned to a specific exception.
(继承自 Exception。)
InnerExceptionGets the Exception instance that caused the current exception.
(继承自 Exception。)
MessageGets a message that describes the current exception.
(继承自 Exception。)
SourceGets or sets the name of the application or the object that causes the error.
(继承自 Exception。)
StackTraceGets a string representation of the immediate frames on the call stack.
(继承自 Exception。)
TargetSiteGets the method that throws the current exception.
(继承自 Exception。)
TechnicalDetails Gets technical details for developer debugging purposes. 获取用于开发人员调试的技术细节

方法

EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetBaseExceptionWhen overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
(继承自 Exception。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the runtime type of the current instance.
(继承自 Exception。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
ToString Overrides ToString() to include error code and technical details when available. 重写ToString()方法,包含错误代码和技术细节(如果存在)
(重写 ExceptionToString)

事件

SerializeObjectStateOccurs when an exception is serialized to create an exception state object that contains serialized data about the exception.
(继承自 Exception。)
已过时

参见