refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.
This commit is contained in:
31
HRD.WebApi/Middleware/HttpStatusCodeException.cs
Normal file
31
HRD.WebApi/Middleware/HttpStatusCodeException.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace HRD.WebApi.Middleware
|
||||
{
|
||||
public class HttpStatusCodeException : Exception
|
||||
{
|
||||
public HttpStatusCode StatusCode { get; set; }
|
||||
public string ContentType { get; set; } = @"text/plain";
|
||||
|
||||
public HttpStatusCodeException(HttpStatusCode statusCode)
|
||||
{
|
||||
this.StatusCode = statusCode;
|
||||
}
|
||||
|
||||
public HttpStatusCodeException(HttpStatusCode statusCode, string message)
|
||||
: base(message)
|
||||
{
|
||||
this.StatusCode = statusCode;
|
||||
}
|
||||
|
||||
public HttpStatusCodeException(HttpStatusCode statusCode, Exception inner)
|
||||
: this(statusCode, inner.ToString()) { }
|
||||
|
||||
//public HttpStatusCodeException(HttpStatusCode statusCode, JObject errorObject)
|
||||
// : this(statusCode, errorObject.ToString())
|
||||
//{
|
||||
// this.ContentType = @"application/json";
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user