This commit is contained in:
Brett Hewitson 2021-11-20 22:16:59 +10:00
parent f6ae6364a9
commit 2e8596e0b7
16 changed files with 588 additions and 1 deletions

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace ServerManager.WebApplication.Models
{
public class ServerManagerApiException : Exception
{
public ServerManagerApiException() : base()
{ }
public ServerManagerApiException(int statusCode, ICollection<string> messages) : base()
{
StatusCode = statusCode;
Messages = messages;
}
public ServerManagerApiException(int statusCode, ICollection<string> messages, Exception innerException) : base(null, innerException)
{
StatusCode = statusCode;
Messages = messages;
}
protected ServerManagerApiException(SerializationInfo info, StreamingContext context) : base(info, context)
{ }
public int StatusCode { get; private set; } = 0;
public ICollection<string> Messages { get; private set; } = new List<string>();
}
}