DocSpace-buildtools/common/ASC.Core.Common/Tenants/TenantExceptions.cs

47 lines
1.3 KiB
C#
Raw Normal View History

2022-02-15 11:52:43 +00:00
namespace ASC.Core.Tenants;
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
[Serializable]
public class TenantTooShortException : Exception
{
public int MinLength { get; set; } = 0;
public int MaxLength { get; set; } = 0;
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
public TenantTooShortException(string message)
: base(message) { }
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
public TenantTooShortException(string message, int minLength, int maxLength)
: base(message)
{
MinLength = minLength;
MaxLength = maxLength;
2020-01-17 13:58:26 +00:00
}
2022-02-15 11:52:43 +00:00
protected TenantTooShortException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
[Serializable]
public class TenantIncorrectCharsException : Exception
{
public TenantIncorrectCharsException(string message)
: base(message) { }
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
protected TenantIncorrectCharsException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
[Serializable]
public class TenantAlreadyExistsException : Exception
{
public IEnumerable<string> ExistsTenants { get; private set; }
2020-01-17 13:58:26 +00:00
2022-02-15 11:52:43 +00:00
public TenantAlreadyExistsException(string message, IEnumerable<string> existsTenants)
: base(message)
{
ExistsTenants = existsTenants ?? Enumerable.Empty<string>();
2020-01-17 13:58:26 +00:00
}
2022-02-15 11:52:43 +00:00
protected TenantAlreadyExistsException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}