Return-Path: Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mail.openembedded.org (Postfix) with ESMTP id 06CFD6D51A for ; Mon, 11 Feb 2019 14:13:07 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id n23so7858640lfl.4 for ; Mon, 11 Feb 2019 06:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DIyHQGqaMCDmHgZHpKnrhKgR4nST0d3XkdAb/o0n26A=; b=HL4HHsUuyAZwn3a/nIgRFnliOTDh2gnrar8Co1raVB+hzPkGiwaZ4jxEa/uxJ5P74s F9m15fTzhuwOYoH+dZIIqj5Klqb4oii56rjx17Nc0/bEdAKhSYzR41HoaMQnHBvxZ3FE rIGpd5CguPtxoQkMcuoqlo2ogNACAltWaH99oUtY8Hi7fUjHfnlLSTUD6SfCU8I5a9WX kPBkTRE6n3D8DLqVDsB4X8WREHj36r0nLfgUblr7/Rkch1+G5sYOW5/Q4fc7XrSsAInF 6ka9i5v1SKSoX2Z/MA6i1llH65BxOXE3v5A9oyunoMVr803A+YksoYh3G6o9h4czWdHx Ju7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DIyHQGqaMCDmHgZHpKnrhKgR4nST0d3XkdAb/o0n26A=; b=H3LRklYsZ4UdaeZQ5ldS3qSKpMEfppijNxiBaeSfLlk8PH2BEMhDgTMAfPFh3ZQzEs Zba2ke1oDOHQjMLSvZyCVhkA/3AMqsehvGUm0c5KaaoTor2ZpiuAn6mWoz/DRaAioueg vxiO5TFNH0ibSl5QAMIKrnyiSv7wpsrI8/bJYgY5pnt00TT/2D4onqdE4ySmfs+gLvZp SVKtNf9f2NO2/ko/V5ouKHc4bkXeIogQgcEnSNfysGOxX8qaD3uXVTyJBzTS38sGItZX egLI0ngcae7Wjp6SQ5P227EXZCTRb10tIXK+HtslgS7dEzZNSYVVYA8rWqtJVxVoFUou B0fw== X-Gm-Message-State: AHQUAuaa4bwBq/ISECRNYRjNMsCiysCBngxCiMrvAkOqh8SupsB/z7zW FOFMdBn+pCuBrKk6/Rd/j1BWGDTt X-Google-Smtp-Source: AHgI3Ib1bDmToZRqU5BT0tk2ZrSu7BoOQKuAWzzTCw+oUvJ0+8ZooLm7PmJyRzDtX1Ygs4wEcZmL3g== X-Received: by 2002:a19:a98f:: with SMTP id s137mr23249305lfe.18.1549894388082; Mon, 11 Feb 2019 06:13:08 -0800 (PST) Received: from alexander-box.luxoft.com ([62.96.135.139]) by smtp.gmail.com with ESMTPSA id n19sm2349785lfe.64.2019.02.11.06.13.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 06:13:07 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Date: Mon, 11 Feb 2019 15:13:01 +0100 Message-Id: <20190211141301.79001-1-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [PATCH] build.py: add unhandled exception information to the logger when executing python tasks X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2019 14:13:08 -0000 Previously this information was simply discarded, which in some cases resulted in generic, unhelpful failures. With this change the user would see what the exception is, but without ugly tracebacks or bulky, irrelevant information from the log file. Signed-off-by: Alexander Kanavin --- bitbake/lib/bb/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 3e2a94edb11..7571421d71b 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -304,9 +304,10 @@ def exec_func_python(func, d, runfile, cwd=None, pythonexception=False): utils.better_exec(comp, {"d": d}, code, "exec_python_func() autogenerated", pythonexception=pythonexception) except (bb.parse.SkipRecipe, bb.build.FuncFailed): raise - except: + except Exception as e: if pythonexception: raise + logger.error(str(e)) raise FuncFailed(func, None) finally: bb.debug(2, "Python function %s finished" % func) -- 2.17.1