mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use ExceptionDispatchInfo
This commit is contained in:
parent
e9ee0ef1f5
commit
bb30d26ffb
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Mime;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AsyncKeyedLock;
|
||||
@ -258,7 +259,7 @@ namespace MediaBrowser.Providers.Manager
|
||||
throw new ArgumentNullException(nameof(source));
|
||||
}
|
||||
|
||||
Exception? saveException = null;
|
||||
ExceptionDispatchInfo? saveException = null;
|
||||
|
||||
try
|
||||
{
|
||||
@ -267,7 +268,7 @@ namespace MediaBrowser.Providers.Manager
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
saveException = ex;
|
||||
saveException = ExceptionDispatchInfo.Capture(ex);
|
||||
_logger.LogError(ex, "Unable to save image {Source}", source);
|
||||
}
|
||||
finally
|
||||
@ -282,14 +283,11 @@ namespace MediaBrowser.Providers.Manager
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
saveException ??= ex;
|
||||
saveException ??= ExceptionDispatchInfo.Capture(ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (saveException is not null)
|
||||
{
|
||||
throw saveException;
|
||||
}
|
||||
saveException?.Throw();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user