gpt4 book ai didi

azure - Azure Pipelines 中失败任务的自定义错误消息

转载 作者:行者123 更新时间:2023-12-02 05:59:10 25 4
gpt4 key购买 nike

用于记录自定义错误消息 Azure Pipeline documentation建议使用以下日志记录命令 (PowerShell):

Write-Host "##vso[task.logissue type=error]Something went very wrong."
exit 1

但是,在管道的摘要(和电子邮件通知)中,我只看到 - 相当不具体 - PowerShell 错误:

enter image description here

那么我怎样才能在摘要中得到错误某事非常错误并且任务失败(这是一个PowerShell脚本)?

最佳答案

根据我的经验,##vso[task.logissue type=error] 按预期工作并创建了一个新的错误框,但后面总是出现此退出代码错误。

为了使任务失败并显示自定义错误消息,我使用了以下内容:

Write-Host "##vso[task.logissue type=error]Something went very wrong."
Write-Host "##vso[task.complete result=Failed]"
exit 0

关于azure - Azure Pipelines 中失败任务的自定义错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72304779/

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