Ver Fonte

Readd logging for ReflectionTypeLoaderException

ghorsington há 5 anos atrás
pai
commit
031a2bd966
2 ficheiros alterados com 5 adições e 2 exclusões
  1. 4 1
      BepInEx/Bootstrap/Chainloader.cs
  2. 1 1
      BepInEx/Bootstrap/TypeLoader.cs

+ 4 - 1
BepInEx/Bootstrap/Chainloader.cs

@@ -245,7 +245,10 @@ namespace BepInEx.Bootstrap
 						Plugins.Remove(pluginGUID);
 
 						Logger.LogError($"Error loading [{pluginInfo.Metadata.Name}] : {ex.Message}");
-						Logger.LogDebug(ex);
+						if (ex is ReflectionTypeLoadException re)
+							Logger.LogDebug(TypeLoader.TypeLoadExceptionToString(re));
+						else
+							Logger.LogDebug(ex);
 					}
 				}
 

+ 1 - 1
BepInEx/Bootstrap/TypeLoader.cs

@@ -72,7 +72,7 @@ namespace BepInEx.Bootstrap
 			return result;
 		}
 
-		private static string TypeLoadExceptionToString(ReflectionTypeLoadException ex)
+		public static string TypeLoadExceptionToString(ReflectionTypeLoadException ex)
 		{
 			StringBuilder sb = new StringBuilder();
 			foreach (Exception exSub in ex.LoaderExceptions)