From vannoord@let.rug.nl Thu Feb 15 11:07:42 2001
Received: from gudrun.let.rug.nl (root@gudrun.let.rug.nl [129.125.8.21])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1FA7gZ23463
	for <prolog@swi.psy.uva.nl>; Thu, 15 Feb 2001 11:07:42 +0100 (MET)
Received: (from vannoord@localhost)
	by gudrun.let.rug.nl (8.9.3/8.9.3) id LAA25971;
	Thu, 15 Feb 2001 11:07:42 +0100
From: "Noord G.J.M. van" <vannoord@let.rug.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <14987.43630.177937.914552@gudrun.let.rug.nl>
Date: Thu, 15 Feb 2001 11:07:42 +0100 (MET)
To: prolog@swi.psy.uva.nl
X-Mailer: VM 6.72 under 21.1 (patch 7) "Biscayne" XEmacs Lucid
Subject: [SWIPL] printing user-defined exception terms in toplevel?



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

