Skip to content

Improve OnUnhandledException errors when loading Plugins #940

@vncoelho

Description

@vncoelho

Currently it is hard to know which plugin is causing the exception

neo> Unhandled exception. System.TypeInitializationException: The type initializer for 'Neo.NeoSystem' threw an exception.
 ---> System.TypeLoadException: Could not load type 'Grpc.Core.ConnectivityState' from assembly 'Grpc.Net.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad'.
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at Neo.Plugins.Plugin.LoadPlugin(Assembly assembly) in /opt/neo/src/Neo/Plugins/Plugin.cs:line 171
   at Neo.Plugins.Plugin.LoadPlugins() in /opt/neo/src/Neo/Plugins/Plugin.cs:line 206
   at Neo.NeoSystem..cctor() in /opt/neo/src/Neo/NeoSystem.cs:line 112
   --- End of inner exception stack trace ---
   at Neo.NeoSystem.CurrentDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e) in /opt/neo/src/Neo/NeoSystem.cs:line 185
   at System.AppContext.OnUnhandledException(Object e)
/opt/start_node.sh: line 2:   116 Aborted                 (core dumped) ( cd /opt/node/Neo.CLI/; dotnet neo-cli.dll )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions