From ad3b401ed304404e5d0595eb76ecacfb9656620f Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Thu, 16 Dec 2021 15:34:33 -0500 Subject: [PATCH] remove re-throws of exceptions, hiding stack trace (#1680) * remove re-throws of exceptions, hiding stack trace * revert to catch all ApiExceptions * add back throw in auditService * whitespace --- src/Core/Services/AuditService.cs | 2 +- src/Core/Services/AuthService.cs | 2 +- src/Core/Services/CipherService.cs | 2 +- src/Core/Services/SendService.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Services/AuditService.cs b/src/Core/Services/AuditService.cs index 49bd709cd..67d138672 100644 --- a/src/Core/Services/AuditService.cs +++ b/src/Core/Services/AuditService.cs @@ -55,7 +55,7 @@ namespace Bit.Core.Services { return new List(); } - throw e; + throw; } } } diff --git a/src/Core/Services/AuthService.cs b/src/Core/Services/AuthService.cs index 02b06475f..ca76c437f 100644 --- a/src/Core/Services/AuthService.cs +++ b/src/Core/Services/AuthService.cs @@ -272,7 +272,7 @@ namespace Bit.Core.Services { if (e.Error == null || e.Error.StatusCode != System.Net.HttpStatusCode.NotFound) { - throw e; + throw; } } return await _cryptoService.MakeKeyAsync(masterPassword, email, kdf, kdfIterations); diff --git a/src/Core/Services/CipherService.cs b/src/Core/Services/CipherService.cs index a0d145709..5f644472d 100644 --- a/src/Core/Services/CipherService.cs +++ b/src/Core/Services/CipherService.cs @@ -732,7 +732,7 @@ namespace Bit.Core.Services catch (ApiException e) { await DeleteAttachmentAsync(id, attachmentId); - throw e; + throw; } } diff --git a/src/Core/Services/SendService.cs b/src/Core/Services/SendService.cs index b9d18d68e..7eeacba55 100644 --- a/src/Core/Services/SendService.cs +++ b/src/Core/Services/SendService.cs @@ -219,12 +219,12 @@ namespace Bit.Core.Services { response = await LegacyServerSendFileUpload(request, send, encryptedFileData); } - catch (Exception e) + catch { if (response != default){ await _apiService.DeleteSendAsync(response.Id); } - throw e; + throw; } break; default: