mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
remove re-throws of exceptions, which clear the stack trace (#1760)
* remove re-throws of exceptions, which clear the stack trace * remove whitespace
This commit is contained in:
parent
44b993ed38
commit
11aafac915
@ -46,7 +46,7 @@ namespace Bit.Admin.HostedServices
|
||||
if (i >= maxMigrationAttempts)
|
||||
{
|
||||
_logger.LogError(e, "Database failed to migrate.");
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -603,7 +603,7 @@ namespace Bit.Billing.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,7 +698,7 @@ namespace Bit.Billing.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,12 +79,9 @@ namespace Bit.Core.Repositories.TableStorage
|
||||
entity.ETag = "*";
|
||||
await _table.ExecuteAsync(TableOperation.Delete(entity));
|
||||
}
|
||||
catch (StorageException e)
|
||||
catch (StorageException e) when (e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
if (e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,12 +88,9 @@ namespace Bit.Core.Repositories.TableStorage
|
||||
ETag = "*"
|
||||
}));
|
||||
}
|
||||
catch (StorageException e)
|
||||
catch (StorageException e) when (e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
if (e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
_logger.LogWarning(e, "Failed to send email. Retrying...");
|
||||
await SendAsync(request, true);
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,12 +133,9 @@ namespace Bit.Core.Services
|
||||
await _installationDeviceRepository.DeleteAsync(new InstallationDeviceEntity(deviceId));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception e) when (e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
|
||||
{
|
||||
if (e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,12 +189,9 @@ namespace Bit.Core.Services
|
||||
{
|
||||
await _client.PatchInstallationAsync(id, new List<PartialUpdateOperation> { operation });
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception e) when (e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
|
||||
{
|
||||
if (e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
await _btGateway.Customer.DeleteAsync(braintreeCustomer.Id);
|
||||
}
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
|
||||
org.Gateway = GatewayType.Stripe;
|
||||
@ -367,7 +367,7 @@ namespace Bit.Core.Services
|
||||
var message = e.Message.ToLowerInvariant();
|
||||
if (message.Contains("apple") || message.Contains("in-app"))
|
||||
{
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -692,7 +692,7 @@ namespace Bit.Core.Services
|
||||
throw new GatewayException("Bank account is not yet verified.");
|
||||
}
|
||||
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1105,7 +1105,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
if (e.Message != $"No such subscription: {subscriber.GatewaySubscriptionId}")
|
||||
{
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1408,13 +1408,13 @@ namespace Bit.Core.Services
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
if (braintreeCustomer != null && !hadBtCustomer)
|
||||
{
|
||||
await _btGateway.Customer.DeleteAsync(braintreeCustomer.Id);
|
||||
}
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
|
||||
return createdCustomer;
|
||||
|
@ -213,7 +213,7 @@ namespace Bit.Setup
|
||||
MigrateDatabase(nextAttempt);
|
||||
return;
|
||||
}
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user