]> code.ossystems Code Review - openembedded-core.git/commitdiff
base: Use repr() for printing exceptions
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 9 Oct 2021 22:33:15 +0000 (23:33 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Oct 2021 21:31:55 +0000 (22:31 +0100)
Exceptions print more clearly using repr() instead of str(), fix
in fetch and unpack tasks.

Drop part of the test which no longer makes sense after this change.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass
meta/lib/oeqa/selftest/cases/bbtests.py

index c0dddcf1745a7db67cf88e562a1ad23d1ac04c7a..59fd46e5d43cf86eb72b6720175a17072387d129 100644 (file)
@@ -160,7 +160,7 @@ python base_do_fetch() {
         fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.download()
     except bb.fetch2.BBFetchException as e:
-        bb.fatal(str(e))
+        bb.fatal("Bitbake Fetcher Error: " + repr(e))
 }
 
 addtask unpack after do_fetch
@@ -177,7 +177,7 @@ python base_do_unpack() {
         fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.unpack(d.getVar('WORKDIR'))
     except bb.fetch2.BBFetchException as e:
-        bb.fatal(str(e))
+        bb.fatal("Bitbake Fetcher Error: " + repr(e))
 }
 
 def get_layers_branch_rev(d):
index 65623640746b630adb20fba2382251b2045e04e8..6779e6210341f01c56c2753b87de0554482b40ce 100644 (file)
@@ -151,9 +151,6 @@ INHERIT:remove = \"report-error\"
         self.delete_recipeinc('man-db')
         self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output)
         self.assertIn('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:', result.output)
-        line = self.getline(result, 'Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.')
-        self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \
-doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output)
 
     def test_rename_downloaded_file(self):
         # TODO unique dldir instead of using cleanall