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

@ -1059,7 +1059,14 @@ namespace MediaBrowser.Server.Implementations.Library
if (ItemAdded != null)
{
ItemAdded(this, new ItemChangeEventArgs { Item = item });
try
{
ItemAdded(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemUpdated event handler", ex);
}
}
}
@ -1077,7 +1084,14 @@ namespace MediaBrowser.Server.Implementations.Library
if (ItemUpdated != null)
{
ItemUpdated(this, new ItemChangeEventArgs { Item = item });
try
{
ItemUpdated(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemUpdated event handler", ex);
}
}
}
@ -1089,7 +1103,14 @@ namespace MediaBrowser.Server.Implementations.Library
{
if (ItemRemoved != null)
{
ItemRemoved(this, new ItemChangeEventArgs { Item = item });
try
{
ItemRemoved(this, new ItemChangeEventArgs { Item = item });
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemRemoved event handler", ex);
}
}
}