mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Throw the exception as is
This commit is contained in:
parent
bb30d26ffb
commit
03271c43a7
@ -259,18 +259,11 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
throw new ArgumentNullException(nameof(source));
|
throw new ArgumentNullException(nameof(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
ExceptionDispatchInfo? saveException = null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var fileStream = AsyncFile.OpenRead(source);
|
var fileStream = AsyncFile.OpenRead(source);
|
||||||
await new ImageSaver(_configurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, fileStream, mimeType, type, imageIndex, saveLocallyWithMedia, cancellationToken);
|
await new ImageSaver(_configurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, fileStream, mimeType, type, imageIndex, saveLocallyWithMedia, cancellationToken);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
saveException = ExceptionDispatchInfo.Capture(ex);
|
|
||||||
_logger.LogError(ex, "Unable to save image {Source}", source);
|
|
||||||
}
|
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -281,15 +274,9 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
{
|
{
|
||||||
_logger.LogError(ex, "Source file {Source} not found or in use, skip removing", source);
|
_logger.LogError(ex, "Source file {Source} not found or in use, skip removing", source);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
saveException ??= ExceptionDispatchInfo.Capture(ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
saveException?.Throw();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public Task SaveImage(Stream source, string mimeType, string path)
|
public Task SaveImage(Stream source, string mimeType, string path)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user