From fcc04d5fd2b13b3c8622d808ba529a0869271058 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Tue, 6 Aug 2024 14:21:32 +0200 Subject: [PATCH] [backend/drive] Improve logging for exceptions during DriveService.StoreFile --- Iceshrimp.Backend/Core/Services/DriveService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Services/DriveService.cs b/Iceshrimp.Backend/Core/Services/DriveService.cs index b3f6d051..2b799933 100644 --- a/Iceshrimp.Backend/Core/Services/DriveService.cs +++ b/Iceshrimp.Backend/Core/Services/DriveService.cs @@ -112,7 +112,15 @@ public class DriveService( : 0; var stream = await GetSafeStreamOrNullAsync(input, maxLength, res.Content.Headers.ContentLength); - return await StoreFile(stream, user, request, skipImageProcessing); + try + { + return await StoreFile(stream, user, request, skipImageProcessing); + } + catch (Exception e) + { + logger.LogWarning("Failed to store downloaded file from {uri}: {error}, storing as link", uri, e); + throw; + } } catch (Exception e) {