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

Loading…
Cancel
Save