utility-tasks.bbclass: Use bb.fatal() instead of raising FuncFailed

This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: de45a7e302fe5a2a08baf26c91e2c788d7285263)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ulf Magnusson
2016-10-01 04:47:09 +02:00
committed by Richard Purdie
parent 4dbb0d73dd
commit 4768cd6519

View File

@@ -47,7 +47,7 @@ python do_checkuri() {
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.checkstatus()
except bb.fetch2.BBFetchException as e:
raise bb.build.FuncFailed(e)
bb.fatal(str(e))
}
addtask checkuriall after do_checkuri