mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
Use ExceptionDispatchInfo
This commit is contained in:
parent
e9ee0ef1f5
commit
bb30d26ffb
1 changed files with 5 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue