mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-02 10:01:34 -04:00
Also log LoaderExceptions for ReflectionTypeLoadException exceptions
This commit is contained in:
parent
abe43b75e1
commit
94e97a12d1
@ -25,7 +25,7 @@ using MCGalaxy.Tasks;
|
||||
|
||||
namespace MCGalaxy.Core {
|
||||
|
||||
public sealed class CorePlugin : Plugin_Simple {
|
||||
public sealed class CorePlugin : Plugin {
|
||||
public override string creator { get { return Server.SoftwareName + " team"; } }
|
||||
public override string MCGalaxy_Version { get { return Server.Version; } }
|
||||
public override string name { get { return "CorePlugin"; } }
|
||||
|
@ -20,7 +20,7 @@ using MCGalaxy.Events;
|
||||
|
||||
namespace MCGalaxy.Core {
|
||||
|
||||
public sealed class NotesPlugin : Plugin_Simple {
|
||||
public sealed class NotesPlugin : Plugin {
|
||||
public override string creator { get { return Server.SoftwareName + " team"; } }
|
||||
public override string MCGalaxy_Version { get { return Server.Version; } }
|
||||
public override string name { get { return "Core_NotesPlugin"; } }
|
||||
|
@ -16,6 +16,7 @@
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace MCGalaxy {
|
||||
@ -130,6 +131,18 @@ namespace MCGalaxy {
|
||||
try { sb.AppendLine("Message: " + ex.Message); } catch { }
|
||||
try { sb.AppendLine("Target: " + ex.TargetSite.Name); } catch { }
|
||||
try { sb.AppendLine("Trace: " + ex.StackTrace); } catch { }
|
||||
|
||||
// For errors with loading plugins (e.g. missing dependancy) you get a
|
||||
// Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
|
||||
// which is pretty useless by itself, so check specifically for this case
|
||||
try {
|
||||
ReflectionTypeLoadException refEx = ex as ReflectionTypeLoadException;
|
||||
if (refEx == null) return;
|
||||
|
||||
sb.AppendLine("## Loader exceptions ##");
|
||||
foreach (Exception loadEx in refEx.LoaderExceptions)
|
||||
DescribeError(loadEx, sb);
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user