Class ExceptionDescriptor
Provides information about an System.Exception, in a developer friendly way.
Namespace: Cuemon.Diagnostics
Assembly: Cuemon.Core.dll
Syntax
public class ExceptionDescriptor
Constructors
| Improve this DocExceptionDescriptor()
Initializes a new instance of the ExceptionDescriptor class.
Declaration
protected ExceptionDescriptor()
ExceptionDescriptor(Exception, String, String, Uri)
Initializes a new instance of the ExceptionDescriptor class.
Declaration
public ExceptionDescriptor(Exception failure, string code, string message, Uri helpLink = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | failure | The System.Exception that caused the current failure. |
System.String | code | The error code that uniquely identifies the type of failure. |
System.String | message | The message that explains the reason for the failure. |
System.Uri | helpLink | The optional link to a help page associated with this failure. |
Remarks
code
will remove any spaces that might be present.
Properties
| Improve this DocCode
Gets an error code that uniquely identifies the type of failure.
Declaration
public string Code { get; }
Property Value
Type | Description |
---|---|
System.String | The number that identifies the type of failure. |
Evidence
Gets a collection of key/value pairs that can provide additional information about the failure.
Declaration
public IReadOnlyDictionary<string, object> Evidence { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> | An optional collection of key/value pairs that can provide additional information about the failure. |
Failure
Gets the System.Exception that caused the current failure.
Declaration
public Exception Failure { get; }
Property Value
Type | Description |
---|---|
System.Exception | The deeper cause of the failure. |
HelpLink
Gets or sets a link to the help page associated with this failure.
Declaration
public Uri HelpLink { get; set; }
Property Value
Type | Description |
---|---|
System.Uri | The location of an optional help page associated with this failure. |
Message
Gets a message that describes the current failure.
Declaration
public string Message { get; }
Property Value
Type | Description |
---|---|
System.String | The message that explains the reason for the failure. |
Methods
| Improve this DocAddEvidence<T>(String, T, Func<T, Object>)
Adds an element of evidence to associate with the faulted operation.
Declaration
public void AddEvidence<T>(string context, T evidence, Func<T, object> evidenceProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | context | The context of the evidence. |
T | evidence | The evidence itself. |
System.Func<T, System.Object> | evidenceProvider | The function delegate that provides the evidence. |
Type Parameters
Name | Description |
---|---|
T | The type of the |
PostInitializeWith(ExceptionDescriptorAttribute)
Post initialize this instance with the specified attribute
.
Declaration
public void PostInitializeWith(ExceptionDescriptorAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ExceptionDescriptorAttribute | attribute |
PostInitializeWith(IEnumerable<ExceptionDescriptorAttribute>)
Post initialize this instance with a matching ExceptionDescriptorAttribute from the specified attributes
.
Declaration
public void PostInitializeWith(IEnumerable<ExceptionDescriptorAttribute> attributes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ExceptionDescriptorAttribute> | attributes | The attributes to find a match within. |