
Hi there,
according to the documentation (emphasis mine):
@subsection{Raising Exceptions}
The following functions offers a way of throwing @concept{exceptions} from C that can be caught in Prolog with @tt{catch/3}. THE TERM THAT REACHES PROLOG IS EXACTLY THE SAME WHICH WAS THROWN BY C. The execution flow is broken at the point where @tt{ciao_raise_exception()} is executed, and it returns to Prolog.
However, it seems that ciao_raise_exception() throws a different term. We obtain:
?- catch(ppl_Polyhedron_add_constraints(p, []), Exception, true).
Exception = error(system_error,'ppl_ciao:ppl_Polyhedron_add_constraints'/2-1) ?
yes ?-
whereas we should obtain:
?- catch(ppl_Polyhedron_add_constraints(p, []), Exception, true). Exception = ppl_invalid_argument(found(p), expected(handle), where('ppl_Polyhedron_add_constraints/2')).
?-
We are sure that the C code throws the term
ppl_invalid_argument(found(p), expected(handle), where('ppl_Polyhedron_add_constraints/2'))
moreover the string "system_error" never occurs in the PPL sources. From this we conclude that the
error(system_error,'ppl_ciao:ppl_Polyhedron_add_constraints'/2-1)
term is synthesized by Ciao itself, and this is causing problems. Are we missing something? Thanks,
Roberto