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 pBMLe3vm008476 for ; Thu, 22 Dec 2011 22:40:03 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvABAFuj807AbSoIe2dsb2JhbABDhQ+kSoJXIgEBFiYEIYFyAQEEASMPAUYQCwkPAgImAgIUGDGIDQKlaJFOE4EciUozYwSNRoc6kjQ X-IronPort-AV: E=Sophos;i="4.71,395,1320620400"; d="scan'208";a="136524329" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2011 22:39:58 +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 pBMLdu2U017600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 22 Dec 2011 22:39:56 +0100 Received: by first (Postfix, from userid 1000) id 29C521540357; Thu, 22 Dec 2011 22:39:56 +0100 (CET) Date: Thu, 22 Dec 2011 22:39:56 +0100 From: oliver To: =?utf-8?B?U3TDqXBoYW5l?= Glondu Cc: caml-list@inria.fr Message-ID: <20111222213956.GA8513@siouxsie> References: <20111222183914.GA6185@siouxsie> <4EF38AD4.10608@glondu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4EF38AD4.10608@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 08:53:56PM +0100, Stéphane Glondu wrote: > Le 22/12/2011 19: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 *) | BadPartial (** Pattern contains items that cannot be used together with partial matching. *) | BadPattern of string * int (** [BadPattern (msg, pos)] regular expression is malformed. The reason is in [msg], the position of the error in the pattern in [pos]. *) | BadUTF8 (** UTF8 string being matched is invalid *) | BadUTF8Offset (** Gets raised when a UTF8 string being matched with offset is invalid. *) | MatchLimit (** Maximum allowed number of match attempts with backtracking or recursion is reached during matching. ALL FUNCTIONS CALLING THE MATCHING ENGINE MAY RAISE IT!!! *) | RecursionLimit | InternalError of string (** [InternalError msg] C-library exhibits unknown/undefined behaviour. The reason is in [msg]. *) Which also mentioned a partial-match error. But Pcre.Error(0) looks somehow cryptical and strange to me. Maybe that old version is just too old. > > 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... 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. (I also tried to create a pcre-ocaml PKGBUILD for Arch Linux, but I would need to fake the install-drectories, so that it would install locally inside the fakeroot... any ideas on that?) Ciao, Oliver