add try/catch for library manager events

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

@ -1059,7 +1059,14 @@ namespace MediaBrowser.Server.Implementations.Library
if (ItemAdded != null) 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) 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) 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);
}
} }
} }

Loading…
Cancel
Save