Core.Blueprint.DAL/Lib.Common.LoggingAPI.Service/DataTranferObjects/Error/HttpErrorDto.cs
Sergio Matias Urquin 6358f5f199 Add project files.
2025-04-29 18:39:57 -06:00

47 lines
1.4 KiB
C#

// ***********************************************************************
// <copyright file="HttpErrorDto.cs">
// Heath
// </copyright>
// ***********************************************************************
using Lib.Common.LoggingAPI.Service.Constants;
using System.ComponentModel;
using System.Text.Json.Serialization;
namespace Lib.Common.LoggingAPI.Service.DataTransferObjects.Error
{
/// <summary>
/// The service HTTP error data transfer object.
/// </summary>
public class HttpErrorDto
{
/// <summary>
/// Gets or sets the error.
/// </summary>
[DisplayName(DisplayNames.Error)]
[JsonPropertyName(DisplayNames.Error)]
public ErrorDetailsDto Error { get; set; }
/// <summary>
/// Creates a new instance of <see cref="HttpErrorDto{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 HttpErrorDto(
string? message,
string? errorCode,
string? target)
{
this.Error = new ErrorDetailsDto
{
ErrorCode = errorCode,
Message = message,
Target = target,
};
}
}
}