From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBMMZkBh010070 for ; Thu, 22 Dec 2011 23:35:46 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8BABaw806K54gDmWdsb2JhbABDhQ+kSoJXIgEBAQEBCAsLBxQlgXIBAQQBIwRRAQULCxoCBRYLAgIJAwIBAgFFBg0BBwKHdgKlXJFVgS+JSoEWBJUBhU+MZA X-IronPort-AV: E=Sophos;i="4.71,396,1320620400"; d="scan'208";a="136527956" Received: from rouge.crans.org ([138.231.136.3]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 22 Dec 2011 23:35:42 +0100 Received: from localhost (localhost.crans.org [127.0.0.1]) by rouge.crans.org (Postfix) with ESMTP id 42926837E; Thu, 22 Dec 2011 23:35:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at crans.org Received: from rouge.crans.org ([10.231.136.3]) by localhost (rouge.crans.org [10.231.136.3]) (amavisd-new, port 10024) with LMTP id WrJcdkxZbJHd; Thu, 22 Dec 2011 23:35:42 +0100 (CET) Received: from [192.168.39.1] (fbx.up7.fr [81.56.96.177]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by rouge.crans.org (Postfix) with ESMTPSA id 055438284; Thu, 22 Dec 2011 23:35:41 +0100 (CET) Message-ID: <4EF3B0BD.7040900@glondu.net> Date: Thu, 22 Dec 2011 23:35:41 +0100 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 MIME-Version: 1.0 To: oliver CC: caml-list@inria.fr References: <20111222183914.GA6185@siouxsie> <4EF38AD4.10608@glondu.net> <20111222213956.GA8513@siouxsie> In-Reply-To: <20111222213956.GA8513@siouxsie> X-Enigmail-Version: 1.1.2 OpenPGP: id=49881AD3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id pBMMZkBh010070 Subject: Re: [Caml-list] Fatal error: exception Pcre.Error(0) Le 22/12/2011 22:39, oliver a écrit : >>> where is there a documentation about these kind of errors from pcre-lib? >>> I'm using Pcre.pmatch, which should just give me a bool. >> >> See pcre.mli. Pcre.Error(0) is the raw representation of Partial (i.e. >> string only matched the pattern partially). > [...] > > In my pcre.mli this error is not mentioned. > > There is a > > > type error = > | Partial (** String only matched the pattern partially *) ^^^^^^^ There. > Which also mentioned a partial-match error. > But Pcre.Error(0) looks somehow cryptical > and strange to me. Pcre.Error(0) is cryptical but not strange: it is the same as Pcre.Error(Pcre.Partial). Whatever gives you the error message mentioning Pcre.Error(0) does not have access to type information, so it cannot give you more than Pcre.Error(0). You didn't tell where the error message came from. >> By the way, in doubt, you can catch Pcre.Error and pattern-match on its >> argument. > > Yes, I think that makes sense. > But Pcre.Error(0) is not very verbose, and I also want to know > what I catch and why... try Pcre.exec ... with Pcre.Error e -> match e with | Partial -> ... | _ -> ... If you are using the generic exception pretty-printer (module Printexc), you can register a pretty-printer for Pcre.Error with Printexc.register_printer. > Installing a newer pcre was easy, but then my build process complains > about multiple stublibs-directories. So I threw it away. > So maybe it's better to change the apt-get stuff instead. The only way a new version of pcre could "fix" that would be if it registered a pretty-printer as explained above. But this is not the case, even in the last version (6.2.4). Cheers, -- Stéphane