[backend/drive] Improve logging for exceptions during DriveService.StoreFile

This commit is contained in:
Laura Hausmann 2024-08-06 14:21:32 +02:00
parent e1d25a9231
commit fcc04d5fd2
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -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)
{