mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
add error handling
This commit is contained in:
parent
b9638b484d
commit
9aea46f823
@ -709,7 +709,10 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
public void StartKillTimer(TimerCallback callback, int intervalMs)
|
public void StartKillTimer(TimerCallback callback, int intervalMs)
|
||||||
{
|
{
|
||||||
CheckHasExited();
|
if (HasExited)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lock (_timerLock)
|
lock (_timerLock)
|
||||||
{
|
{
|
||||||
@ -728,7 +731,10 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
public void ChangeKillTimerIfStarted()
|
public void ChangeKillTimerIfStarted()
|
||||||
{
|
{
|
||||||
CheckHasExited();
|
if (HasExited)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lock (_timerLock)
|
lock (_timerLock)
|
||||||
{
|
{
|
||||||
@ -741,14 +747,6 @@ namespace MediaBrowser.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckHasExited()
|
|
||||||
{
|
|
||||||
if (HasExited)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Job");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -56,6 +56,11 @@ namespace MediaBrowser.Api.Library
|
|||||||
/// <param name="appPaths">The app paths.</param>
|
/// <param name="appPaths">The app paths.</param>
|
||||||
public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths)
|
public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths)
|
||||||
{
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(path))
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("path");
|
||||||
|
}
|
||||||
|
|
||||||
if (!fileSystem.DirectoryExists(path))
|
if (!fileSystem.DirectoryExists(path))
|
||||||
{
|
{
|
||||||
throw new DirectoryNotFoundException("The path does not exist.");
|
throw new DirectoryNotFoundException("The path does not exist.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user