Fix exception logging

This commit is contained in:
Bond_009
2018-12-20 13:11:26 +01:00
parent bf01918659
commit ea4c914123
123 changed files with 565 additions and 607 deletions

View File

@@ -1414,7 +1414,7 @@ namespace MediaBrowser.Controller.Entities
}
catch (Exception ex)
{
Logger.LogError("Error refreshing owned items for {0}", ex, Path ?? Name);
Logger.LogError(ex, "Error refreshing owned items for {path}", Path ?? Name);
}
}

View File

@@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Entities
}
catch (Exception ex)
{
Logger.LogError("Error loading library options", ex);
Logger.LogError(ex, "Error loading library options");
return new LibraryOptions();
}

View File

@@ -303,7 +303,7 @@ namespace MediaBrowser.Controller.Entities
var id = child.Id;
if (dictionary.ContainsKey(id))
{
Logger.LogError("Found folder containing items with duplicate id. Path: {0}, Child Name: {1}",
Logger.LogError("Found folder containing items with duplicate id. Path: {path}, Child Name: {ChildName}",
Path ?? Name,
child.Path ?? child.Name);
}

View File

@@ -259,10 +259,9 @@ namespace MediaBrowser.Controller.Entities
{
return _libraryManager.GetGenre(i);
}
catch
catch (Exception ex)
{
// Full exception logged at lower levels
_logger.LogError("Error getting genre");
_logger.LogError(ex, "Error getting genre");
return null;
}
@@ -383,10 +382,9 @@ namespace MediaBrowser.Controller.Entities
{
return _libraryManager.GetGenre(i);
}
catch
catch (Exception ex)
{
// Full exception logged at lower levels
_logger.LogError("Error getting genre");
_logger.LogError(ex, "Error getting genre");
return null;
}