From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0B6CCBB81 for ; Fri, 13 Jan 2006 15:57:35 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0DEvYsS008634 for ; Fri, 13 Jan 2006 15:57:34 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA06919 for ; Fri, 13 Jan 2006 15:57:34 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k0DEvWY0019232 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 13 Jan 2006 15:57:33 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1ExQm6-0003xs-00 for ; Fri, 13 Jan 2006 15:23:34 +0000 Date: Fri, 13 Jan 2006 15:23:34 +0000 To: caml-list@inria.fr Subject: Printexc cannot print some (but not all) exceptions Message-ID: <20060113152333.GA14618@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at nez-perce with ID 43C7BFDE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43C7BFDC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; printexc:01 printexc:01 foobar:01 foobar:01 baz:01 baz:01 stdlib:01 ocamlfind:01 ocamlopt:01 -package:01 netclient:01 -linkpkg:01 exn:01 prerr:01 endline:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi, We have an annoying problem that sometimes Printexc seems unable to print exceptions. Http_client.Http_error is one such exception that seems like it can never be printed: Http_client.Http_error(_) # from Printexc.to_string (("Http_client.Http_error"), (2, "foobar")) # from my dumper Unix.Unix_error(0, "foobar", "baz") # from Printexc.to_string (("Unix.Unix_error"), 0, "foobar", "baz") # from my dumper Print.MyException(1, "foobar") # from Printexc.to_string (("Print.MyException"), 2, "foobar") # from my dumper (The test program which generates this is at the end of the message). I don't understand what the common factor is which stops exceptions from being printed, and the code in stdlib/printexc.ml seems fairly equivalent to my "dumper" code. Ideas? Rich. ------------------------------------------------------------- print.ml -- (* ocamlfind ocamlopt -package extlib,netclient -linkpkg print.ml -o print *) exception MyException of int * string;; try raise (Http_client.Http_error (1, "foobar")) with exn -> prerr_endline (Printexc.to_string exn);; try raise (Http_client.Http_error (2, "foobar")) with exn -> prerr_endline (Std.dump exn);; try raise (Unix.Unix_error (Unix.E2BIG, "foobar", "baz")) with exn -> prerr_endline (Printexc.to_string exn);; try raise (Unix.Unix_error (Unix.E2BIG, "foobar", "baz")) with exn -> prerr_endline (Std.dump exn);; try raise (MyException (1, "foobar")) with exn -> prerr_endline (Printexc.to_string exn);; try raise (MyException (2, "foobar")) with exn -> prerr_endline (Std.dump exn);; -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com