Adding
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Exceptions
|
||||
{
|
||||
public class AccountCreationFailed : ApplicationException
|
||||
{
|
||||
public AccountCreationFailed(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a missing requirement for processing an account; this account CANNOT be tried again later.
|
||||
/// </summary>
|
||||
public class IneligibleAccountException : Exception
|
||||
{
|
||||
public string Field { get; set; }
|
||||
public string Reason { get; set; }
|
||||
|
||||
public IneligibleAccountException(string field, string reason) : base(field)
|
||||
{
|
||||
Field = field;
|
||||
Reason = reason;
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a missing requirement for processing an account; which will mean the account can be tried again later.
|
||||
/// </summary>
|
||||
public class MissingRequirementException : Exception
|
||||
{
|
||||
public string Field { get; set; }
|
||||
public string Advice { get; set; }
|
||||
|
||||
public MissingRequirementException(string field, string advice) : base(field)
|
||||
{
|
||||
Field = field;
|
||||
Advice = advice;
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Exceptions
|
||||
{
|
||||
/**
|
||||
* If an entity cannot be found, that specific error can allow for a 404 or 400 with more detail to be
|
||||
* returned. So specify that to the API layer.
|
||||
*/
|
||||
public class NotFoundException : ApplicationException
|
||||
{
|
||||
public NotFoundException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Exceptions
|
||||
{
|
||||
/**
|
||||
* Do not want to expose database and related exceptions to the controllers / web layer.
|
||||
* The lower layers log what happened for developers, then return a general error; unless
|
||||
* a more specific error can be returned in a way to allow the client to act (such as NotFound).
|
||||
*/
|
||||
// IF YOU SEE THIS EXCEPTION IN SEQ, IT MEANS YES, YOU HAVE TO INVESTIGATE.
|
||||
public class ServerErrorException : Exception
|
||||
{
|
||||
public ServerErrorException(): base("[INVESTIGATE] A server error occured. See associated logs.") { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user