add try/catch for library manager events

pull/702/head
Luke Pulverenti 12 years ago
parent 43845b4052
commit b5d9cb9fab

@ -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>

Loading…
Cancel
Save