add statuscode to apiexception

This commit is contained in:
Pascal Schedel
2024-10-25 07:35:03 +02:00
parent e3ce952cbc
commit 25a8cd48be
3 changed files with 12 additions and 3 deletions

View File

@@ -1,11 +1,20 @@
namespace Pilz.Net.Api;
using System.Net;
namespace Pilz.Net.Api;
public class ApiException : Exception
{
public HttpStatusCode StatusCode { get; }
public ApiException()
{
}
public ApiException(string? message, HttpStatusCode statusCode) : base(message)
{
StatusCode = statusCode;
}
public ApiException(string? message) : base(message)
{
}