From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24402: should-error doesn't catch all errors Date: Tue, 11 Jul 2017 08:18:43 -0400 Message-ID: <87fue3f9p8.fsf@users.sourceforge.net> References: <3654D8E9-D3CB-402B-922F-B132C1871E9F@runbox.com> <596E65D2-E780-43A1-A75B-603B61B6F9F4@runbox.com> <87zickhoco.fsf_-_@lylat> <877eznda7v.fsf@lylat> <874lur0zki.fsf@calancha-pc> <87o9sywtbz.fsf@lylat> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499775496 27257 195.159.176.226 (11 Jul 2017 12:18:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Jul 2017 12:18:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: Gemini Lasswell , Tino Calancha , 24402@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 11 14:18:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUu7F-0006dn-Pd for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jul 2017 14:18:09 +0200 Original-Received: from localhost ([::1]:46053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUu7K-0002DN-Oe for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Jul 2017 08:18:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUu7B-0002C1-E2 for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2017 08:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUu78-0002ik-94 for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2017 08:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUu78-0002iW-2z for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2017 08:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dUu77-0007uk-Qm for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2017 08:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jul 2017 12:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 24402-submit@debbugs.gnu.org id=B24402.149977543930366 (code B ref 24402); Tue, 11 Jul 2017 12:18:01 +0000 Original-Received: (at 24402) by debbugs.gnu.org; 11 Jul 2017 12:17:19 +0000 Original-Received: from localhost ([127.0.0.1]:33418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUu6R-0007ti-4D for submit@debbugs.gnu.org; Tue, 11 Jul 2017 08:17:19 -0400 Original-Received: from mail-it0-f66.google.com ([209.85.214.66]:34323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUu6P-0007tV-Mv for 24402@debbugs.gnu.org; Tue, 11 Jul 2017 08:17:18 -0400 Original-Received: by mail-it0-f66.google.com with SMTP id o202so2785196itc.1 for <24402@debbugs.gnu.org>; Tue, 11 Jul 2017 05:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=TdZfaBKbSfubgoxSc6NIPerDz7+8taZ/IYYHTOr30bA=; b=rIYntnXAL4s/+nLIg7tTK4P5lUWka7q3r81TyjoniMA+XCCKfAF2GmJoOuM9CB8V/z ZMlpmpYC2SMW0ph4MeyEqOpViSAEEts/LTPn11nyt4wBokHPTJLApmgNJhxj7Fh6QCt9 9UsCcU+WPE0f0TGsXkpIDYEtUuifYsqUvEp7hIzmLCaYBrxRaPnGzejVp8r1y483hHWU VZu4ZzR3C++0i/R+UppLAzMDDbdsB6lO5QVJy6h/WjtM6Bg1hTplVUW9xQ1Tl3o6gxOG X08xy5YYC5h7j+wP0s0ItmJ3ZoHg4T1kLLNI06AJoIF50cgJkixU/7dpCE0uat7qHL1R cNJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=TdZfaBKbSfubgoxSc6NIPerDz7+8taZ/IYYHTOr30bA=; b=JRx8vLpGCCbDFiuhOHT6XqL1HLG/vY3iLPEAg49OXPiSOq+bMc4XrJ4B8epXQ6tu+x eu3ZKQUK8cgVGO69CTCHi8YRay4/0T/KNZXMj2rdqHlfg2TDXn+FBoLmqW7ATZ4oJf9b rSu4Jq/43JFmPYZRCBTGfhPpzj/kT6tHFdEX2jmsGX1EdahkeceGwgvx25hCTV953HtP o/UWkovxWGrcuLQ07UljQMtggwj5yYEJY2UVGeaxlEfDFjk5Rlj6odD+ouJFcTpSYZLU UiNNcEGK1ulNcSWFd2sQd+0Fxd+jP1qSkf9QQB5UeUG+KcPivRERLhcN94UEU9AQ66pR oRsA== X-Gm-Message-State: AIVw112S4tEmmgA/Y69XcA0TIp6ZWOmrqcKFDdlG9JAOQIs5yGJQti+p 4hvQ/cX3SqxtYQ== X-Received: by 10.36.118.80 with SMTP id z77mr16771899itb.53.1499775432200; Tue, 11 Jul 2017 05:17:12 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l27sm2675005ioi.6.2017.07.11.05.17.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 05:17:11 -0700 (PDT) In-Reply-To: <87o9sywtbz.fsf@lylat> (Alex's message of "Wed, 05 Jul 2017 13:56:48 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:134429 Archived-At: Alex writes: > I believe the following is why my previous diff doesn't work. Consider: > > (let ((test (make-ert-test :body (lambda () (ert-fail "failed"))))) > (ert-run-test test)) > > The above returns a struct/record and does not error. > > (let ((test (make-ert-test :body (lambda () (ert-fail "failed"))))) > (condition-case err > (ert-run-test test) > (error "woops"))) > > Even though ert-run-test by itself does not error, the error handler is > ran. I believe this is because `ert--run-test-internal' binds `debugger' > around the evaluation of the test to somehow suppress this error. Yes, ert binds `debugger' in order to get full backtrace information when there is an error. This means it won't see errors caught by condition-case. That's good when it ignores errors caught by test code using condition-case, but does give rise to problems. There is some relevant discussion in Bugs #11218 and #24617. Espcially the suggestion in #24617 of using `signal-hook-function' to record error info instead of using `debugger', I think doing this could simplify things a lot. It is definitely going to require messing around with ert's internals though...