-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors could use SWI messaging infrastructure. #59
Comments
Here is an example of using the prolog:error_message//1 hook:
Which then gives me:
|
Hi @jburse . This seems to follow something else as you started with "Also..." I am a bit lost of what this is about. Is the file you are linking from an old SWI version? I cannot find https://www.swi-prolog.org/pldoc/man?section=printmsg There are no matches for, for example, `error_message/1': https://www.swi-prolog.org/search?for=error_message Can you elaborate more? |
Ohh I see, yes. I found the file under There is not much documentation in SWIPL manual, if anything. If I understand correctly, what you are suggesting is to improve the way that JPL throws exceptions, and instead of just putting the error in the text of the exception, build a set of structured errors (e.g., yours Is this what you are proposing/suggesting? If so, it does make sense, would be nice indeed. Now, seems you are talking about exceptions on the Prolog side, when Prolog calls JPL? There is another pack of exceptions on the Java side. |
True. There is this tutorial: http://www.pathwayslms.com/swipltuts/message/index.html
I think that is the way to go. The PR by @dtonhofer works in that direction, but I don't think it introduces new types and domains, but instead (still) explains this using the comment arguments. |
Great @JanWielemaker , thanks for that pointer, I think that should help a lot. Now that I am finished with Dictionaries and Maven work, both work perfectly, I will look at that with @dtonhofer. |
Also there is something strange that JPL doesn’t extend term_message//1. It has all the text directly inside the throw. But I guess the idea is that there is a message infrastructure that translates formal errors to text.
Maybe JPL could extend prolog:error_message//1. Don’t know what the official hook is. prolog:error_message//1 is probed by term_message//1, but prolog:error_message//1 is not further documented.
See also:
https://www.swi-prolog.org/pldoc/doc/_SWI_/boot/messages.pl?show=src#term_message//1
The text was updated successfully, but these errors were encountered: