Hi,
Why not just catch the standard c++ exception and show the "what"?
Currently I´m using the code below in all exported methods but I think it
would be easier if the rexx itself does the "catch" and show the exception.
Is there a better way and I don´t know it?
try
{
(...)
}
catch(std::exception &e)
{
context->RaiseException1(Rexx_Error_Application_error,context->NewStringFromAsciiz(e.what()));
}
2013/11/18 David Ashley <[email protected]>
> All -
>
> I working with building an ooRexx library to the Linux libvirt library
> and I ran across something that I think needs to be added to ooRexx but
> I am not sure where or how it might be best implemented.
>
> When you write C++ code that will become a method for an ooRexx class
> implementation (or a function implementation as well) there may be cases
> where you want to throw an exception back to the interpreter due to an
> internal problem within the C++ code. For instance, you needed to open a
> file but could not, you ran out of memory, somehow a bad pointer was
> given to you (a NULL pointer for instance), etc. At this point you want
> to throw an exception but the problem is that there are no exceptions
> that fit your problem available as a Rexx exception.
>
> I tried using an exception where I should have been able to supply my
> own error message (93000) but the message never appeared on the console
> and I got a generic message instead. So i do not know if I was not
> coding the exception call correctly or if there was something else
> amiss.
>
> In any case I am still trying to figure out what the best way to handle
> these types of errors are. Do we need more messages in the library or do
> we handle this as a generic case with a single type of exception?
>
> David Ashley
>
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
--
Perry Werneck
Brasília/DF
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel