mirror of
https://github.com/bitwarden/server.git
synced 2025-07-07 02:52:50 -05:00
Turn on file scoped namespaces (#2225)
This commit is contained in:
@ -1,31 +1,30 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
|
||||
namespace Bit.Core.Exceptions
|
||||
namespace Bit.Core.Exceptions;
|
||||
|
||||
public class BadRequestException : Exception
|
||||
{
|
||||
public class BadRequestException : Exception
|
||||
public BadRequestException(string message)
|
||||
: base(message)
|
||||
{ }
|
||||
|
||||
public BadRequestException(string key, string errorMessage)
|
||||
: base("The model state is invalid.")
|
||||
{
|
||||
public BadRequestException(string message)
|
||||
: base(message)
|
||||
{ }
|
||||
|
||||
public BadRequestException(string key, string errorMessage)
|
||||
: base("The model state is invalid.")
|
||||
{
|
||||
ModelState = new ModelStateDictionary();
|
||||
ModelState.AddModelError(key, errorMessage);
|
||||
}
|
||||
|
||||
public BadRequestException(ModelStateDictionary modelState)
|
||||
: base("The model state is invalid.")
|
||||
{
|
||||
if (modelState.IsValid || modelState.ErrorCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ModelState = modelState;
|
||||
}
|
||||
|
||||
public ModelStateDictionary ModelState { get; set; }
|
||||
ModelState = new ModelStateDictionary();
|
||||
ModelState.AddModelError(key, errorMessage);
|
||||
}
|
||||
|
||||
public BadRequestException(ModelStateDictionary modelState)
|
||||
: base("The model state is invalid.")
|
||||
{
|
||||
if (modelState.IsValid || modelState.ErrorCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ModelState = modelState;
|
||||
}
|
||||
|
||||
public ModelStateDictionary ModelState { get; set; }
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
namespace Bit.Core.Exceptions
|
||||
namespace Bit.Core.Exceptions;
|
||||
|
||||
public class GatewayException : Exception
|
||||
{
|
||||
public class GatewayException : Exception
|
||||
{
|
||||
public GatewayException(string message, Exception innerException = null)
|
||||
: base(message, innerException)
|
||||
{ }
|
||||
}
|
||||
public GatewayException(string message, Exception innerException = null)
|
||||
: base(message, innerException)
|
||||
{ }
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
namespace Bit.Core.Exceptions
|
||||
{
|
||||
public class InvalidEmailException : Exception
|
||||
{
|
||||
public InvalidEmailException()
|
||||
: base("Invalid email.")
|
||||
{
|
||||
namespace Bit.Core.Exceptions;
|
||||
|
||||
public class InvalidEmailException : Exception
|
||||
{
|
||||
public InvalidEmailException()
|
||||
: base("Invalid email.")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
namespace Bit.Core.Exceptions
|
||||
{
|
||||
public class InvalidGatewayCustomerIdException : Exception
|
||||
{
|
||||
public InvalidGatewayCustomerIdException()
|
||||
: base("Invalid gateway customerId.")
|
||||
{
|
||||
namespace Bit.Core.Exceptions;
|
||||
|
||||
public class InvalidGatewayCustomerIdException : Exception
|
||||
{
|
||||
public InvalidGatewayCustomerIdException()
|
||||
: base("Invalid gateway customerId.")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
namespace Bit.Core.Exceptions
|
||||
{
|
||||
public class NotFoundException : Exception { }
|
||||
}
|
||||
namespace Bit.Core.Exceptions;
|
||||
|
||||
public class NotFoundException : Exception { }
|
||||
|
Reference in New Issue
Block a user