From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBN0E6Q7012640 for ; Fri, 23 Dec 2011 01:14:06 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvABAPzG807AbSoIe2dsb2JhbABDhQ+kTIJXIgEBFiYEIYFyAQEEASMECwFGEAsJDwICJgICFBgxiA0CpViRUBOBHIlKM2MEjUaHOpI0 X-IronPort-AV: E=Sophos;i="4.71,396,1320620400"; d="scan'208";a="124382299" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Dec 2011 01:14:01 +0100 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178031165.adsl.alicedsl.de [85.178.31.165]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id pBN0DxfN026274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 23 Dec 2011 01:13:59 +0100 Received: by first (Postfix, from userid 1000) id 18EDE1540357; Fri, 23 Dec 2011 01:13:59 +0100 (CET) Date: Fri, 23 Dec 2011 01:13:59 +0100 From: oliver To: =?utf-8?B?U3TDqXBoYW5l?= Glondu Cc: caml-list@inria.fr Message-ID: <20111223001358.GA12304@siouxsie> References: <20111222183914.GA6185@siouxsie> <4EF38AD4.10608@glondu.net> <20111222213956.GA8513@siouxsie> <4EF3B0BD.7040900@glondu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4EF3B0BD.7040900@glondu.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] Fatal error: exception Pcre.Error(0) On Thu, Dec 22, 2011 at 11:35:41PM +0100, Stéphane Glondu wrote: > 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. So, (0) stands for the first entry in the list I assume. BadPartial-exception then would be Pcre.Error(1). ? That there is only returned an int, instead of the type information, where does that come from? Why is that not available? Does it coming from working together with the *.c stuff? > > >> 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. Hmhhh. Not used that stuff so far. > > > 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). OK, thanks. I also looked now, at what the original package offers... ...for example with "make doc" a lot of additional nice docs will be created. That was not offered by my OS-based installation. So, looking at the source package was an interesting experience. Ciao, Oliver