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

Revert filescoped (#2227)

* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2a.
This commit is contained in:
Justin Baur
2022-08-29 15:53:48 -04:00
committed by GitHub
parent 239286737d
commit bae03feffe
1208 changed files with 74317 additions and 73126 deletions

View File

@ -1,30 +1,31 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Bit.Core.Exceptions;
public class BadRequestException : Exception
namespace Bit.Core.Exceptions
{
public BadRequestException(string message)
: base(message)
{ }
public BadRequestException(string key, string errorMessage)
: base("The model state is invalid.")
public class BadRequestException : Exception
{
ModelState = new ModelStateDictionary();
ModelState.AddModelError(key, errorMessage);
}
public BadRequestException(string message)
: base(message)
{ }
public BadRequestException(ModelStateDictionary modelState)
: base("The model state is invalid.")
{
if (modelState.IsValid || modelState.ErrorCount == 0)
public BadRequestException(string key, string errorMessage)
: base("The model state is invalid.")
{
return;
ModelState = new ModelStateDictionary();
ModelState.AddModelError(key, errorMessage);
}
ModelState = modelState;
}
public BadRequestException(ModelStateDictionary modelState)
: base("The model state is invalid.")
{
if (modelState.IsValid || modelState.ErrorCount == 0)
{
return;
}
public ModelStateDictionary ModelState { get; set; }
ModelState = modelState;
}
public ModelStateDictionary ModelState { get; set; }
}
}

View File

@ -1,8 +1,9 @@
namespace Bit.Core.Exceptions;
public class GatewayException : Exception
namespace Bit.Core.Exceptions
{
public GatewayException(string message, Exception innerException = null)
: base(message, innerException)
{ }
public class GatewayException : Exception
{
public GatewayException(string message, Exception innerException = null)
: base(message, innerException)
{ }
}
}

View File

@ -1,10 +1,11 @@
namespace Bit.Core.Exceptions;
public class InvalidEmailException : Exception
namespace Bit.Core.Exceptions
{
public InvalidEmailException()
: base("Invalid email.")
public class InvalidEmailException : Exception
{
public InvalidEmailException()
: base("Invalid email.")
{
}
}
}

View File

@ -1,10 +1,11 @@
namespace Bit.Core.Exceptions;
public class InvalidGatewayCustomerIdException : Exception
namespace Bit.Core.Exceptions
{
public InvalidGatewayCustomerIdException()
: base("Invalid gateway customerId.")
public class InvalidGatewayCustomerIdException : Exception
{
public InvalidGatewayCustomerIdException()
: base("Invalid gateway customerId.")
{
}
}
}

View File

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