<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 1:02 PM, Christopher Larson <span dir="ltr">&lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 9:34 AM, Christopher Larson <span dir="ltr">&lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra"><span><div class="gmail_quote">On Thu, Sep 15, 2016 at 2:15 PM, Christopher Larson <span dir="ltr">&lt;<a href="mailto:kergoth@gmail.com" target="_blank">kergoth@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>From: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;<br>
<br>
We don&#39;t want a traceback for this exception, we need to catch it, fire<br>
TaskFailed, and return failure.<br>
<br>
Signed-off-by: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;<br>
---<br>
 lib/bb/build.py | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/lib/bb/build.py b/lib/bb/build.py<br>
index 28401b3..8581e72 100644<br>
--- a/lib/bb/build.py<br>
+++ b/lib/bb/build.py<br>
@@ -575,6 +575,9 @@ def _exec_task(fn, task, d, quieterr):<br>
             logger.error(str(exc))<br>
             event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata)<br>
         return 1<br>
+    except bb.BBHandledException:<br>
+        event.fire(TaskFailed(task, logfn, localdata, True), localdata)<br>
+        return 1</div></blockquote></div><br></span>Don’t merge this, v2 is forthcoming. Apparently firing the TaskFailed is problematic if it was the TaskStarted event handler which failed, as the UI won’t have the pid of the task, resulting in this:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">Traceback (most recent call last):</div><div class="gmail_extra">  File &quot;/scratch/dogwood/pdk-licensin<wbr>g/poky/bitbake/lib/bb/ui/knott<wbr>y.py&quot;, line 426, in main</div><div class="gmail_extra">    helper.eventHandler(event)</div><div class="gmail_extra">  File &quot;/scratch/dogwood/pdk-licensin<wbr>g/poky/bitbake/lib/bb/ui/uihel<wbr>per.py&quot;, line 48, in eventHandler</div><div class="gmail_extra">    del self.running_tasks[event.pid]</div></div></blockquote></div><br></div></div>This is superceded by &#39;bb.build: in _exec_task, catch errors from TaskStarted’. Please review/apply that rather than this. Thanks.</blockquote></div><br>Sigh, was on the wrong patch. We want this one, it’s not superceded. Ignore all this, a v2 series is forthcoming.<br>-- <br><div data-smartmail="gmail_signature"><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div></div>
</div></div>