1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-07 02:52:50 -05:00

Run formatting (#2230)

This commit is contained in:
Justin Baur
2022-08-29 16:06:55 -04:00
committed by GitHub
parent 9b7aef0763
commit 7f5f010e1e
1205 changed files with 73813 additions and 75022 deletions

View File

@ -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; }
}

View File

@ -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)
{ }
}

View File

@ -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.")
{
}
}
}

View File

@ -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.")
{
}
}
}

View File

@ -1,4 +1,3 @@
namespace Bit.Core.Exceptions
{
public class NotFoundException : Exception { }
}
namespace Bit.Core.Exceptions;
public class NotFoundException : Exception { }