1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05: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:
Jake Fink
2021-12-16 15:35:07 -05:00
committed by GitHub
parent 44b993ed38
commit 11aafac915
8 changed files with 19 additions and 31 deletions

View File

@ -130,7 +130,7 @@ namespace Bit.Core.Services
{
_logger.LogWarning(e, "Failed to send email. Retrying...");
await SendAsync(request, true);
throw e;
throw;
}
}

View File

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

View File

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