From 75d887470698a5f312610cebd58be58aee7eaa9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Socha?= <31014760+lukaszsocha2@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:24:42 +0200 Subject: [PATCH] fix: Catch all exceptions when getting User Agent header (#901) Closes: SDK-3096 --- Box.V2/Managers/BoxResourceManager.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Box.V2/Managers/BoxResourceManager.cs b/Box.V2/Managers/BoxResourceManager.cs index c434ecfbd..c05d3a982 100644 --- a/Box.V2/Managers/BoxResourceManager.cs +++ b/Box.V2/Managers/BoxResourceManager.cs @@ -302,11 +302,7 @@ private string GetEnvNameAndVersion() { ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(Subkey); } - catch (UnauthorizedAccessException) - { - return ""; - } - catch (SecurityException) + catch (Exception) { return ""; }