HttpExceptionDescriptor Class
Definition
- Namespace
- Cuemon.AspNetCore.Diagnostics
- Assemblies
- Cuemon.AspNetCore.dll
Provides information about an Exception, in a developer friendly way, optimized for open- and otherwise public application programming interfaces (API). Implements the ExceptionDescriptor
public class HttpExceptionDescriptor : ExceptionDescriptor
- Inheritance
-
HttpExceptionDescriptor
- Inherited Members
Examples
The following example demonstrates creating an HTTP exception descriptor with diagnostic evidence.
using System;
using Cuemon.AspNetCore.Http;
namespace Cuemon.AspNetCore.Diagnostics;
public static class HttpExceptionDescriptorExample
{
public static void Demonstrate()
{
var descriptor = new HttpExceptionDescriptor(new BadRequestException())
{
Instance = new Uri("urn:request:42"),
RequestId = "req-42",
CorrelationId = "corr-42"
};
Console.WriteLine($"{descriptor.StatusCode} {descriptor.Message}");
}
}
Constructors
| Name | Description |
|---|---|
| HttpExceptionDescriptor(Exception, int, string, string, Uri) | Initializes a new instance of the HttpExceptionDescriptor class. |
Properties
| Name | Description |
|---|---|
| CorrelationId | Gets or sets the correlation identifier that allows a reference to a particular transaction or event chain the caller made. |
| Instance | Gets or sets the URI that identifies the specific occurrence of the problem. |
| RequestId | Gets or sets the request identifier that uniquely identifies the service request the caller made. |
| StatusCode | Gets or sets the HTTP status code of the service request the caller made. |
| TraceId | Gets or sets the trace identifier that uniquely identifies the trace of the service request the caller made. |