I’m using Hydra to access C# non visual code from a Delphi host application and it works just fine.
However, on some occasions, the C# code can throw exceptions that inherit from a common base type, say MyPluginException.
On the Delphi side, I would like to distinguish between those exceptions like so:
try
Plugin.CallMethod;
except
on E: MyPluginException do
Process(E);
end;
So that, exceptions that derive from MyPluginException are processed while any other exception is left untouched.
However, right now, I’m not getting any specific type for these exceptions, they all are raised as EOleException without any details.
I mean, sure, there is the message, but I’m missing the source C# exception name and its associated stack trace. The former would allow me to do a switch while the latter would allow me to give more details to our support team (we are using madExcept for the Delphi side, for instance).
Is this something that is feasible? If yes, how would you suggest that I do it?
For SDK it is free in terms of performance and code complexity (I mean user code here). Here it would need an additional layer of abstraction ho handle a situation (exception paasing from plugin to the host) that should be a corner-case.
However I will log an issue to discuss if we should add the GetLastError method as a part of built-in functionality in Hydra.