From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11218: with-demoted-errors use of condition-case-unless-debug; ert Date: Fri, 20 Apr 2012 08:13:25 -0400 Message-ID: References: <4F8DE112.5010106@gnu.org> <4F90D369.7070005@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334924036 31293 80.91.229.3 (20 Apr 2012 12:13:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2012 12:13:56 +0000 (UTC) Cc: 11218@debbugs.gnu.org To: Christian Ohler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 20 14:13:55 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SLCio-0001hw-QC for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Apr 2012 14:13:54 +0200 Original-Received: from localhost ([::1]:53056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLCin-0004ji-TG for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Apr 2012 08:13:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLCif-0004gM-QX for bug-gnu-emacs@gnu.org; Fri, 20 Apr 2012 08:13:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLCiY-0005PH-AE for bug-gnu-emacs@gnu.org; Fri, 20 Apr 2012 08:13:45 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLCiY-0005Ox-7V for bug-gnu-emacs@gnu.org; Fri, 20 Apr 2012 08:13:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SLCiv-0007zh-VW for bug-gnu-emacs@gnu.org; Fri, 20 Apr 2012 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Apr 2012 12:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11218-submit@debbugs.gnu.org id=B11218.133492403830713 (code B ref 11218); Fri, 20 Apr 2012 12:14:01 +0000 Original-Received: (at 11218) by debbugs.gnu.org; 20 Apr 2012 12:13:58 +0000 Original-Received: from localhost ([127.0.0.1]:43733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLCip-0007zF-IE for submit@debbugs.gnu.org; Fri, 20 Apr 2012 08:13:57 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:40683) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLCim-0007z7-Ju for 11218@debbugs.gnu.org; Fri, 20 Apr 2012 08:13:54 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q3KCDQel020176; Fri, 20 Apr 2012 08:13:27 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 562E5AE201; Fri, 20 Apr 2012 08:13:25 -0400 (EDT) In-Reply-To: <4F90D369.7070005@gnu.org> (Christian Ohler's message of "Thu, 19 Apr 2012 20:09:29 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4197=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4197> : streams <748467> : uri <1101375> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59316 Archived-At: >> So the next question is: why does ERT record a backtrace and that extra >> information provided by ert-info? > To be able to show them to the user, together with the test failure. If you > have one or more failing tests, it's much more useful to see the error > messages and backtraces rather than just the error messages. I don't see the point of showing that info when running the tests. If the user wants that info, he should be able to easily say "run this test with debug-on-error" so he doesn't only get a backtrace but also gets put in the debugger where he can inspect the state. > (ert-deftest foo () > (with-demoted-errors (error "a")) > (error "b")) > would normally fail with "b", but if we enable debugging to track down why, > it will fail with "a" instead (with no way to continue execution to get to > the error we are interested in). No: you'll be put in the debugger for the error "a" but if you hit `c' it will continue and re-enter the debugger for error "b". > Fundamentally, having conditionals in the code that explicitly check > debug-on-error' seems like asking for trouble. I agree it's not something we should do in general, but with-demoted-error was designed largely for the specific case where errors should not happen (i.e. if one happens, we want to be able to debug it easily by setting debug-on-error), but at the same time you know very well how the program should respond in case of an unexpected error (so the user who's not in a position to fix the bug can get his job done). Stefan