50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
|
using ServiceShared.Database;
|
|||
|
|
|||
|
namespace ServiceShared.Models.Response.Exception
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// This exception will be thrown when response was not successfully and contains some of exception
|
|||
|
/// </summary>
|
|||
|
public class ResponseException
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Types of exception
|
|||
|
/// </summary>
|
|||
|
public enum Types
|
|||
|
{
|
|||
|
InvalidClient = 1000,
|
|||
|
InvalidRequest = 1001,
|
|||
|
MissingArgument = 1002,
|
|||
|
InvalidArgument = 1003,
|
|||
|
Unknown = 1004,
|
|||
|
AlreadySubscribted = 1005,
|
|||
|
NotAuthorized = 1007,
|
|||
|
MaxOpenedRequestLimit = 1008,
|
|||
|
NotAvailable = 1009,
|
|||
|
WrongFileChecksum = 1010,
|
|||
|
SupportCodeNeeded = 1011,
|
|||
|
Maintenance = 1012
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Response type (error)
|
|||
|
/// </summary>
|
|||
|
public string response_type { get; } = "Error";
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Error type of current response
|
|||
|
/// </summary>
|
|||
|
public virtual Types error_type { get; } = Types.InvalidRequest;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Error message of current response
|
|||
|
/// </summary>
|
|||
|
public virtual string message { get; } = null;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Get Application version
|
|||
|
/// </summary>
|
|||
|
public virtual string version { get; set; } = DbContext.GetCurrentVersion();
|
|||
|
}
|
|||
|
}
|