Search
Saturday, 27th of June 2020, 22:08:34 UTC
23:50:38
jcowan
How do you arrange for a random Java exception coming from the FFI to be reflected as a corresponding CL condition?
23:53:02
no-defun-allowed
java:register-java-exception?
23:53:20
no-defun-allowed
(java:register-java-exception "ExceptionName" 'condition-name)
1:08:09
jcowan
Dr Google finds absolutely nothing about such a symbol, though
1:08:45
jcowan
huh, but now it does
1:11:15
jcowan
anyway, the interesting bit is what happens to the fields in the Throwable, and whether you can get a hold of them
4:40:51
easye
jcowan: The java exception should be "wrapped" as a JAVA-OBJECT reference for further introspection.
4:42:50
easye
e.g. <https://github.com/armedbear/abcl/blob/bca11a225a64466c785e291d5d01f19fc8c09ac3/src/org/armedbear/lisp/java.lisp#L469>
4:49:10
easye
N.b. note that the JAVA-EXCEPTION class is in the JAVA package, so one often needs to specify its type with the package prefix to get it to "bind" correctly, i.e (handler-bind ... (java:java-exception e) ...)
4:50:38
easye
"N.b. note" department of redundant redundancy... sheez.
Sunday, 28th of June 2020, 10:08:34 UTC