From jan@swi.psy.uva.nl Thu Feb 15 13:10:53 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1FCArZ28107;
	Thu, 15 Feb 2001 13:10:53 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id NAA02383;
	Thu, 15 Feb 2001 13:10:53 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Noord G.J.M. van" <vannoord@let.rug.nl>, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] printing user-defined exception terms in toplevel?
Date: Thu, 15 Feb 2001 13:08:52 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <14987.43630.177937.914552@gudrun.let.rug.nl>
In-Reply-To: <14987.43630.177937.914552@gudrun.let.rug.nl>
MIME-Version: 1.0
Message-Id: <01021513105300.01604@gollem>
Content-Transfer-Encoding: 8bit

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

