[armedbear-devel] Catching CL errors in java

Alessio Stalla alessiostalla at gmail.com
Tue Feb 19 16:07:29 UTC 2013


Short story: if you call into Lisp using the JSR-223 API, conditions
are automatically rethrown as Java exceptions.

Long story: the way this is implemented is by binding *debugger-hook*
to an internal, probably undocumented function, that already does what
you want. It is called sys::%debugger-hook-function.

On Tue, Feb 19, 2013 at 4:25 PM, Jonathan Fischer Friberg
<odyssomay at gmail.com> wrote:
> I should add that a solution from inside CL would also work. I'm using the
> ABCL eval to execute all code, so maybe I could wrap the call with something
> like this:
>
> (handler-case
>    (... do-stuff ...)
>    (... catch CL-condition + throw java exception ...))
>
> I don't know if that would work. Also, my CL skills are not good enough to
> finish the code above (how do I capture all conditions?), so help would be
> appreciated.
>
> Jonathan
>
>
> On Tue, Feb 19, 2013 at 3:30 PM, Jonathan Fischer Friberg
> <odyssomay at gmail.com> wrote:
>>
>> Hi again, :)
>>
>> I'm currently running CL-code from java. The gui is completely implemented
>> on the java side. It would be nice if all errors occuring inside abcl could
>> be captured from the java side (to be displayed in the gui as an error). Is
>> that possible?
>>
>> Jonathan
>
>
>
> _______________________________________________
> armedbear-devel mailing list
> armedbear-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
>



-- 
Some gratuitous spam:

http://ripple-project.org Ripple, social credit system
http://villages.cc Villages.cc, Ripple-powered community economy
http://common-lisp.net/project/armedbear ABCL, Common Lisp on the JVM
http://code.google.com/p/tapulli my current open source projects
http://www.manydesigns.com/ ManyDesigns Portofino, open source
model-driven Java web application framework




More information about the armedbear-devel mailing list