From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D9A27BC88 for ; Thu, 3 Feb 2005 13:40:44 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j13Cei71024812 for ; Thu, 3 Feb 2005 13:40:44 +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 NAA04190 for ; Thu, 3 Feb 2005 13:40:44 +0100 (MET) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j13Ceh91024807 for ; Thu, 3 Feb 2005 13:40:43 +0100 Received: from localhost (akasha.ijm.jussieu.fr [134.157.173.57]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id j13CehgM016493 ; Thu, 3 Feb 2005 13:40:43 +0100 (CET) X-Ids: 165 Date: Thu, 03 Feb 2005 13:40:42 +0100 (CET) Message-Id: <20050203.134042.63128009.andrieu@ijm.jussieu.fr> To: m.lahr@re-entry.de Cc: caml-list@inria.fr Subject: Re: [Caml-list] Matching Unix_error From: Olivier Andrieu In-Reply-To: <20050203111702.GA31877@re-entry.de> References: <20050203111702.GA31877@re-entry.de> X-Mailer: Mew version 4.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.7.2 (shiva.jussieu.fr [134.157.0.165]); Thu, 03 Feb 2005 13:40:43 +0100 (CET) X-Miltered: at concorde with ID 42021BCC.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42021BCB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 42021BCB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Spam: no; 0.00; caml-list:01 andrieu:01 andrieu:01 ijm:01 incorrectly:01 ocamlc:01 foo:01 foo:01 cmo:01 ocamlc:01 escaping:01 client's:98 ...:98 exception:01 unix:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Michael Lahr [Thu, 3 Feb 2005]: > Hi, > > i'm trying something like this: > > let start () = > try pipe#run() with > Unix.Unix_error(_,_,_) -> print_string "matched\n" > | _ -> print_string "not matched\n"; raise e ; > > start();; > > where pipe is a http_client's pipeline. > > The output is: > > not matched > Fatal error: exception Unix.Unix_error(38, "connect", "") > > what's wrong here? shouldn't the expression Unix.Unix_error(_,_,_) match > this error? > btw this error occurs only when running under oUnit. > Any clues? I had this problem once, it was due to a library that was incorrectly packaged. The library was built like this : ocamlc -a -o foo.cma unix.cma foo.cmo ... i.e. the library itself included unix.cma. When I built my program like this : ocamlc -o my_prog unix.cma foo.cma my_prog.ml it had this behavior (the exceptions escaping the try .. with). -- Olivier