Page 1 of 1

Report Error Detection

PostPosted: Mon Jul 26, 2021 5:31 pm
by SBarnes
Is there a way to detect when Report Error is called on the manager i.e. when Jiwa catches an exception produced by a plugin?

What I am trying to get is the StackTrace during testing with a client.

Re: Report Error Detection  Topic is solved

PostPosted: Tue Jul 27, 2021 6:16 pm
by Mike.Sheen
SBarnes wrote:Is there a way to detect when Report Error is called on the manager i.e. when Jiwa catches an exception produced by a plugin?

What I am trying to get is the StackTrace during testing with a client.


Jiwa.exe adds a handler for the AppDomain.CurrentDomain.UnhandledException - and that calls the Manager.ReportError (and ReportError doesn't have useful parameters - just a message string and module string - no exception object and thus no stack trace) - so I think what you really want is to have something in the UnhandledException handler to raise an event which you could hook into.

You could always put Try Catch blocks around all your plugin code and log or display it yourself.

Logged DEV-8810 to open up the unhandled exception handling to plugins.

Re: Report Error Detection

PostPosted: Tue Jul 27, 2021 6:23 pm
by SBarnes
Mike.Sheen wrote:Jiwa.exe adds a handler for the AppDomain.CurrentDomain.UnhandledException - and that calls the Manager.ReportError (and ReportError doesn't have useful parameters - just a message string and module string - no exception object and thus no stack trace) - so I think what you really want is to have something in the UnhandledException handler to raise an event which you could hook into.

You could always put Try Catch blocks around all your plugin code and log or display it yourself.

Logged DEV-8810 to open up the unhandled exception handling to plugins.


Yeah I tried an unhandled exception handler and it didn't work as I believe one in Jiwa clears the error and first chance exception gives you more messages than are necessary.

Re: Report Error Detection

PostPosted: Tue Jul 27, 2021 6:37 pm
by Mike.Sheen
SBarnes wrote:Yeah I tried an unhandled exception handler and it didn't work as I believe one in Jiwa clears the error


No - we don't clear it - but I would hazard a guess that by merely handling it, it's no longer considered unhandled and so anyone else won't get the event?