add try/catch for library manager events

This commit is contained in:
Luke Pulverenti 2013-05-03 13:26:44 -04:00
parent 43845b4052
commit b5d9cb9fab

View File

@ -1058,9 +1058,16 @@ namespace MediaBrowser.Server.Implementations.Library
UpdateItemInLibraryCache(item);
if (ItemAdded != null)
{
try
{
ItemAdded(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemUpdated event handler", ex);
}
}
}
/// <summary>
@ -1076,9 +1083,16 @@ namespace MediaBrowser.Server.Implementations.Library
UpdateItemInLibraryCache(item);
if (ItemUpdated != null)
{
try
{
ItemUpdated(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemUpdated event handler", ex);
}
}
}
/// <summary>
@ -1088,9 +1102,16 @@ namespace MediaBrowser.Server.Implementations.Library
public void ReportItemRemoved(BaseItem item)
{
if (ItemRemoved != null)
{
try
{
ItemRemoved(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemRemoved event handler", ex);
}
}
}
/// <summary>