using System.Net;
namespace Galaeth.Core.Exceptions;
///
/// Service exception to be fed back into the response.
///
public class ServiceException : Exception
{
///
/// Initializes a new instance of the class.
///
/// Error code to provide.
/// Error message to provide.
public ServiceException(string errorCode, string errorMessage)
: base(errorMessage)
{
ErrorCode = errorCode;
ErrorMessage = errorMessage;
}
///
/// Initializes a new instance of the class.
///
/// Error code to provide.
/// Error message to provide.
/// The http status code to provide.
public ServiceException(string errorCode, string errorMessage, HttpStatusCode httpStatusCode)
: base(errorMessage)
{
ErrorCode = errorCode;
ErrorMessage = errorMessage;
HttpStatusCode = httpStatusCode;
}
///
/// Standard error code.
///
public string ErrorCode { get; }
///
/// Error message.
///
public string ErrorMessage { get; }
///
/// Http Status Code.
///
public HttpStatusCode HttpStatusCode { get; } = HttpStatusCode.BadRequest;
}