From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 8B3D4BBAF for ; Mon, 31 May 2010 23:43:02 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuIBAAbKA0xKfVI2mGdsb2JhbACeIggVAQEBAQEICQwHESKvI4IChR0uiE8BAQMFhREE X-IronPort-AV: E=Sophos;i="4.53,335,1272837600"; d="scan'208";a="63723394" Received: from mail-ww0-f54.google.com ([74.125.82.54]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 May 2010 23:43:01 +0200 Received: by wwb22 with SMTP id 22so540398wwb.27 for ; Mon, 31 May 2010 14:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=uwYsekBr9j4uhUEgopvz6Yknz4JZyMXGvNtsmdci3qE=; b=f8dr1o+QHGGRqKJfgP3n+h0zUzlhkj7XGV8K/j648X6N0KU2dzFEsx83ZbQd99aERV NwNrEZV6bc210Mn2hPaWa8objW1/iyKNxRpQDzpuNFeKpl2IU1OvO4QW1Qf4ecSKRKjN ERUhenRKBCitIw+1HUeGF2rDw6snvH6frjNxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=TKrv0lEzSTPkP0a+6RBi9ecFKAFfRVupqRq8zcpl+WDVJS7DNbBLfbE6WfvG7brMnF NMt+b/EPVX/jjb93Cevl9F5XKcFDbRm/nsj0V33QjjO5xgqBAKEG2l7tkOAjun5iw+Ev WHNMeVoSUe0xuSCM+5FHx/KEbayetxgDK+Uvk= MIME-Version: 1.0 Received: by 10.216.87.143 with SMTP id y15mr4687083wee.104.1275342170725; Mon, 31 May 2010 14:42:50 -0700 (PDT) Received: by 10.216.46.199 with HTTP; Mon, 31 May 2010 14:42:50 -0700 (PDT) In-Reply-To: References: <20100527170122.GA28273@annexia.org> <87y6f0cf4p.fsf@frosties.localdomain> <4c040e62.9608e30a.4b34.6623@mx.google.com> Date: Mon, 31 May 2010 23:42:50 +0200 Message-ID: Subject: Re: [Caml-list] Static exception analysis or alternative to using exceptions From: blue storm To: Lukasz Stafiniak Cc: Nicolas Pouillard , caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; syntax:01 backtrace:01 printexc:01 verbose:01 exn:01 printf:01 printf:01 exn:01 printexc:01 backtrace:01 storm:98 exception:01 caml-list:01 exceptions:01 exceptions:01 > I use a syntax extension that catches "Not_found" and raises a failure > instead, with the source location of the "real" offending call. I do > this mostly because OUnit catches exceptions so backtraces are of no > use. I have encoutered the same problem and resolved it with explicit backtrace handling in Printexc. I use the following function wrapper : let verbose_func func x = try func x with exn -> Printf.printf "Test error %s\n%!" (Pinrtexc.to_string exn); Printf.printf "%s\n%!" (Printexc.get_backtrace ()); raise exn in