From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA32116; Wed, 5 Jun 2002 00:53:48 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA32112 for ; Wed, 5 Jun 2002 00:53:47 +0200 (MET DST) Received: from moutng1.kundenserver.de (moutng1.kundenserver.de [212.227.126.171]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g54MrlL29376 for ; Wed, 5 Jun 2002 00:53:47 +0200 (MET DST) Received: from [212.227.126.160] (helo=mrelayng0.kundenserver.de) by moutng1.kundenserver.de with esmtp (Exim 3.22 #2) id 17FNBQ-0000My-00; Wed, 05 Jun 2002 00:53:44 +0200 Received: from [80.129.100.71] (helo=gate.gerd-stolpmann.de) by mrelayng0.kundenserver.de with asmtp (Exim 3.35 #1) id 17FNBQ-0002ur-00; Wed, 05 Jun 2002 00:53:44 +0200 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id 6A9CDCCDD; Wed, 5 Jun 2002 00:53:39 +0200 (CEST) Received: from ice (localhost [127.0.0.1]) by ice.gerd-stolpmann.de (Postfix) with ESMTP id 61AF81AD7B; Wed, 5 Jun 2002 00:53:38 +0200 (MEST) Date: Wed, 5 Jun 2002 00:53:38 +0200 From: Gerd Stolpmann To: gaurav_chanda@lycos.com Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] PXP Message-ID: <20020605005338.A623@ice.gerd-stolpmann.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-Reply-To: ; from gaurav_chanda@lycos.com on Tue, Jun 04, 2002 at 18:19:08 +0200 X-Mailer: Balsa 1.2.4 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 2002.06.04 18:19 Gaurav Chanda wrote: > Hello > > I am using PXP to parse and validate an XML document. The follwing code > > > > > examples.getStateName > > > 41 > > > > > gave this error at runtime: > Fatal error: exception Pxp_types.At("In entity [toplevel] = ANONYMOUS, at line 2, position 12:", _) > > Could anybody help me solve this problem ? In addition to Stefano's answer: Unfortunately, you do not get the full error message. This is an annoying problem of the runtime environment. Try the following code in the toploop: # raise(At("x",WF_error "y"));; Exception: Pxp_types.At ("x", Pxp_types.WF_error "y"). # try raise(At("x",WF_error "y")) with any -> Failure(Printexc.to_string any);; - : exn = Failure "Pxp_types.At(_)" If you compile raise(At("x",WF_error "y")), and start the program, you get a third variant: Fatal error: exception Pxp_types.At("x", _) There are three different built-in routines to print uncaught exceptions, and all three have different capabilitites, and only one can print nested exceptions. The workaround for PXP is to use the special exception printer Pxp_types.string_of_exn like try with error -> failwith(Pxp_types.string_of_exn error) and you get always an exception that can be printed, regardless which printer happens to catch the exception. Gerd -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 45 64293 Darmstadt EMail: gerd@gerd-stolpmann.de Germany ---------------------------------------------------------------------------- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners