Subject: Re: [SWIPL] printing user-defined exception terms in toplevel?

From: Jan Wielemaker <[email-masked]>
Date: Thu, 15 Feb 2001 13:08:52 +0100

On Thu, 15 Feb 2001, Noord G.J.M. van wrote:
>Is there a way to ensure that an uncaught exception is printed in a
>readable format, if that uncaught exception is a user-defined one?
>
>I have:
>
>?- fsa_regex_compile(ddddd(a,b),L).    
>ERROR: Unhandled exception: fsa_error([69, 114, 114, 111, 114, 32, 105, 110, 32, 114, 101, 103, 117, 108, 97, 114, 32, 101, 120, 112, 114, 101, 115, 115, 105, 111, 110, 58, 126, 110, 126, 64, 126, 110], [write_term(ddddd(a, b), [max_depth(6)])])
>
>I want to define a hook predicate which will display this fsa_error/2 
>differently.
>
>In some Prologs, portray_message/2 can be used for this, I believe.

There is message_hook/3, but most probably you want to define
additional rules for prolog:message/3.  If you look in boot/messages/3
it will become clear how message handling works, what message-terms
are used and how to modify it.

	--- Jan