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

From: "Noord G.J.M. van" <[email-masked]>
Date: Thu, 15 Feb 2001 11:07:42 +0100 (MET)

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.

Gertjan

-- 
Gertjan van Noord Alfa-informatica, RUG,  Postbus 716, 9700 AS Groningen
vannoord at let dot rug dot nl            http://www.let.rug.nl/~vannoord