From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FEB1C433EF for ; Sat, 23 Oct 2021 23:29:17 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00A9A60C4D for ; Sat, 23 Oct 2021 23:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00A9A60C4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B7538352B; Sun, 24 Oct 2021 01:28:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Os+qw9Dj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BED283557; Sun, 24 Oct 2021 01:27:33 +0200 (CEST) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C71508291E for ; Sun, 24 Oct 2021 01:27:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x330.google.com with SMTP id x27-20020a9d459b000000b0055303520cc4so9260922ote.13 for ; Sat, 23 Oct 2021 16:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NjeXvwhXSd2gOh5Hlj9/jqu8vi5/msjBHvc7796Ld4=; b=Os+qw9DjF6R2NUXVmjXPDkJ7fEwC+f6tgQNWYhwnuOQyBLcJJMpK6CMLS0HCZ2Ht1a bWqfwnxDZN3Ey2eB6CAg71W4+41hy+dJhZlfhhqi9R6DACUds/BIOV06nc5APvSsyAgc dbrag3ZW+Cdqu5qVCkpXFXHlj7apYMh6PHmhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+NjeXvwhXSd2gOh5Hlj9/jqu8vi5/msjBHvc7796Ld4=; b=4hmfw6vQPp3Z+VzLG9rTEQgRGMYPEJW6jnO62PBsnyujfyleBDnXhib5uGXDF9absA iEhHsL00QrsviZ2P+LlZkjRQ9VOCy2Zoqg6Dk+3Wti+0aeWRqUoncHQiz15W3bOJ7wac 6Gm+sfveTzIRkCo5B9YyvirMeeUjUsPjldqiTJbSVx2KwcSjwWZuq25ava0ZGDlnfRvv xSw8XvGxdNc9uf7VTO7Bg8NTrfaHRpeaxcRqhVehFTJPv8SbanyP2ur9B2fQ1tcsqKsw EpRqf+wc6WLjNe2tCYyESff73Ur+nfyRSRShbAYNgFY7MXK79Dl3KQZmesXqz8qHxSn7 seXQ== X-Gm-Message-State: AOAM533/0SNOCJfJZXL87Z3WAFw1ss1K/OXjLK1Tt+zin4zseJfiyXJH Uhjq3tFAGszXALzSeAugK/+o3JQqmqB5jA== X-Google-Smtp-Source: ABdhPJwCCQOqlz71E49kra7G4tTYUTYE9helrQqQHazI2ROyQph0dZD2MHH3ZyEDAYLHaywXb9H67g== X-Received: by 2002:a05:6830:1c6d:: with SMTP id s13mr6732913otg.158.1635031624332; Sat, 23 Oct 2021 16:27:04 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id l24sm2253885oop.4.2021.10.23.16.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Oct 2021 16:27:04 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Michal Simek , Heinrich Schuchardt , Tom Rini , Ilias Apalodimas , Daniel Schwierzeck , Steffen Jaeckel , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Lukas Auer , Dennis Gilmore , Simon Glass , Stephen Warren , Stephen Warren Subject: [PATCH v2 18/41] test/py: Raise a ValueError if a command fails Date: Sat, 23 Oct 2021 17:26:12 -0600 Message-Id: <20211023232635.9195-17-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211023232635.9195-1-sjg@chromium.org> References: <20211023232635.9195-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean At present an Exception is raised if a command fails. This is a very broad class and makes it difficult for callers to catch the error without also catching other things, like programming bugs. Change it to ValueError to make this easier. Signed-off-by: Simon Glass --- (no changes since v1) test/py/multiplexed_log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py index 9325fae46d2..6688207fb31 100644 --- a/test/py/multiplexed_log.py +++ b/test/py/multiplexed_log.py @@ -165,7 +165,7 @@ class RunAndLog(object): if output and not output.endswith('\n'): output += '\n' if exit_status and not exception and not ignore_errors: - exception = Exception('Exit code: ' + str(exit_status)) + exception = ValueError('Exit code: ' + str(exit_status)) if exception: output += str(exception) + '\n' self.logfile.write(self, output) -- 2.33.0.1079.g6e70778dc9-goog