Core.BluePrint.Packages/Core.Blueprint.Logging/Adapters/HttpError.cs
2025-05-17 23:14:35 -06:00

46 lines
1.3 KiB
C#

// ***********************************************************************
// <copyright file="HttpErrorDto.cs">
// AgileWebs
// </copyright>
// ***********************************************************************
using System.ComponentModel;
using System.Text.Json.Serialization;
namespace Core.Blueprint.Logging
{
/// <summary>
/// The service HTTP error data transfer object.
/// </summary>
public class HttpError
{
/// <summary>
/// Gets or sets the error.
/// </summary>
[DisplayName(DisplayNames.Error)]
[JsonPropertyName(DisplayNames.Error)]
public ErrorDetails Error { get; set; }
/// <summary>
/// Creates a new instance of <see cref="HttpError{TMessage}"/>
/// with custom parameters.
/// </summary>
/// <param name="message">The HTTP error message.</param>
/// <param name="errorCode">The HTTP error code.</param>
/// <param name="target">The HTTP error target.</param>
public HttpError(
string? message,
string? errorCode,
string? target)
{
Error = new ErrorDetails
{
ErrorCode = errorCode,
Message = message,
Target = target,
};
}
}
}