Add Exception middleware
This commit is contained in:
22
Shared/AppException.cs
Normal file
22
Shared/AppException.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Diary.Shared
|
||||
{
|
||||
public class AppException : Exception
|
||||
{
|
||||
public string Title { get; }
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
|
||||
public AppException(HttpStatusCode statusCode, string title, string message) : base(message)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
Title = title;
|
||||
}
|
||||
|
||||
public AppException(HttpStatusCode statusCode, string title, string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
Title = title;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user