Skip to content

Explicitly check exit code of CraftMaster and exit on error

Ingo Klöcker requested to merge work/kloecker/windows-error-handling into master

Better explicit than implicit, in particular, if implicit error handling fails us. We would probably also have to check the clone commands, but if cloning fails then one of the CraftMaster calls will also fail.

GitLab should actually handle errors in PowerShell (see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1142), but there's also the still open https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1514.

I have tested/prototyped this here: Without explicit LASTEXITCODE checks: https://invent.kde.org/kloecker/ci-prototyping/-/jobs/1429507 -> job succeeded although python exited with error With explicit LASTEXITCODE checks: https://invent.kde.org/kloecker/ci-prototyping/-/jobs/1429508 -> job failed as expected With explicit LASTEXITCODE check in the function: https://invent.kde.org/kloecker/ci-prototyping/-/jobs/1429517 -> job failed as expected

Actual job where the problem occurs: https://invent.kde.org/network/tokodon/-/jobs/1420124

Merge request reports