mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-11 02:20:20 +08:00
38 lines
910 B
C#
38 lines
910 B
C#
using System.Net;
|
|
|
|
namespace BuildingBlocks.Exception;
|
|
|
|
public class CustomException : System.Exception
|
|
{
|
|
public CustomException(
|
|
string message,
|
|
HttpStatusCode statusCode = HttpStatusCode.InternalServerError,
|
|
int? code = null) : base(message)
|
|
{
|
|
StatusCode = statusCode;
|
|
Code = code;
|
|
}
|
|
|
|
public CustomException(
|
|
string message,
|
|
System.Exception innerException,
|
|
HttpStatusCode statusCode = HttpStatusCode.InternalServerError,
|
|
int? code = null) : base(message, innerException)
|
|
{
|
|
StatusCode = statusCode;
|
|
Code = code;
|
|
}
|
|
|
|
public CustomException(
|
|
HttpStatusCode statusCode = HttpStatusCode.InternalServerError,
|
|
int? code = null) : base()
|
|
{
|
|
StatusCode = statusCode;
|
|
Code = code;
|
|
}
|
|
|
|
public HttpStatusCode StatusCode { get; }
|
|
|
|
public int? Code { get; }
|
|
}
|