Open fsahmad opened 5 years ago
Dear @fsahmad,
Apologies for the delayed response. We had long discussions about this, and there is really not a good way to do this in my opinion without introducing global variables in the DLL which are an absolute nightmare for other reasons.
Our personal best practice here would be that global methods are always "non-throwing", for example in your case, the CreateApp Method would not have any parameters but just give you an App Instance that then is followed up by a "Initialize" call that has a proper error management.
@martinweismann: Do you have any thoughts?
Best regards,
Alex
Currently, the error string propagation works by calling
RegisterErrorMessage
on the base class whenever an exception is caught on the component side, which is then propagated to the binding and wrapped into a new exception.This doesn't work for the global (
CWrapper
) methods, as there is no base class instance to register the error message on.We ran into this issue as our "application" object is created and initialized using a global
CreateApp
method, which was throwing astd::exception
due to missing runtime libraries. I would suggest to add the same mechanism to theCWrapper
class so it too can propagate error messages.