gpt4 book ai didi

yocto how to add a error handler for a specified task?(yocto如何为指定任务添加错误处理程序?)

转载 作者:bug小助手 更新时间:2023-10-22 15:10:26 26 4
gpt4 key购买 nike



I want to add a error handler for do_image_* tasks of core-image-minimal(e.g., when do_image_* failed, execute my handler).

我想为核心映像最小的do_image_*任务添加一个错误处理程序(例如,当do_image_*失败时,执行我的处理程序)。


I tried bb.build.TaskFailed, but it seems to be for all tasks. What should I do?

我尝试了bb.build.TaskFailed,但它似乎适用于所有任务。我该怎么办?


更多回答
优秀答案推荐

I found a solution that works. If there are other more suitable solutions, please let me know, thank you. Everyone is welcome to discuss.

我找到了一个有效的解决方案。如果还有其他更合适的解决方案,请告诉我,谢谢。欢迎大家讨论。


I use the bb.build.TaskFailed event, although it's global, not specific to a recipe. In the handler body, I use e.getTask() to determine whether the specified task failed, and if so, execute my code.

我使用bb.build.TaskFailed事件,尽管它是全局的,而不是特定于配方。在处理程序主体中,我使用e.getTask()来确定指定的任务是否失败,如果失败,则执行我的代码。


addhandler cjlhandler
python cjlhandler() {
bb.warn("TaskName is %s" % e.getTask())
# you should add if statement to determine whether the specified task failed
}
cjlhandler[eventmask] = "bb.build.TaskFailed"

更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com