From b29bdf37d75bffb6dd21b31b9d112fc6fad9833d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Carpenter=20=F0=9F=9B=AB?= Date: Thu, 18 Jul 2024 13:13:44 -0700 Subject: [PATCH] update BlobStorageHandler logging errors --- .../Utility/BlobStorageHandler.cs | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.Devices.HardwareDevCenterManager/Utility/BlobStorageHandler.cs b/src/Microsoft.Devices.HardwareDevCenterManager/Utility/BlobStorageHandler.cs index 9e04fe8..5a029ca 100644 --- a/src/Microsoft.Devices.HardwareDevCenterManager/Utility/BlobStorageHandler.cs +++ b/src/Microsoft.Devices.HardwareDevCenterManager/Utility/BlobStorageHandler.cs @@ -1,7 +1,7 @@ /*++ Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the MIT license. See LICENSE file in the project root for full license information. + Licensed under the MIT license. See LICENSE file in the project root for full license information. --*/ using Azure; @@ -40,17 +40,11 @@ public async Task Upload(string filePath) } catch (RequestFailedException rfe) { - Console.WriteLine("{process} {method} - RequestFailedException error uploading blob. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(Download), - rfe.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(Download)} - RequestFailedException error uploading blob. Error - {rfe.Message}"); } catch (Exception ex) { - Console.WriteLine("{process} {method} - Exception uploading blob. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(DownloadToString), - ex.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(DownloadToString)} - Exception uploading blob. Error - {ex.Message}"); } return; @@ -74,17 +68,11 @@ public async Task Download(string filePath) } catch (RequestFailedException rfe) { - Console.WriteLine("{process} {method} - RequestFailedException error downloading blob to file. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(Download), - rfe.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(Download)} - RequestFailedException error downloading blob to file. Error - {rfe.Message}"); } catch (Exception ex) { - Console.WriteLine("{process} {method} - Exception downloading blob to file. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(DownloadToString), - ex.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(DownloadToString)} - Exception downloading blob to file. Error - {ex.Message}"); } return; @@ -112,17 +100,11 @@ public async Task DownloadToString() } catch (RequestFailedException rfe) { - Console.WriteLine("{process} {method} - RequestFailedException error downloading blob to string. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(DownloadToString), - rfe.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(DownloadToString)} - RequestFailedException error downloading blob to string. Error - {rfe.Message}"); } catch (Exception ex) { - Console.WriteLine("{process} {method} - Exception downloading blob to string. Error - {errorMessage}", - nameof(BlobStorageHandler), - nameof(DownloadToString), - ex.Message); + Console.WriteLine($"{nameof(BlobStorageHandler)} {nameof(DownloadToString)} - Exception downloading blob to string. Error - {ex.Message}"); } return string.Empty;