Added support for step errors when executing backend (#817)

When executing a backend step, in case of failure of the specific step, the run is marked as errored but the step error is missing.

Added:
1. Log for the backend error (without trace)
2. Mark the step as errored with exit code 126 (Could not execute).

Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anton Bracke <anton@ju60.de>
This commit is contained in:
Zav Shotan
2022-05-11 07:40:44 -04:00
committed by GitHub
parent bdb007e064
commit acbcc53872
5 changed files with 111 additions and 78 deletions

View File

@@ -8,15 +8,17 @@
<Icon name="close" class="ml-auto" />
</div>
<div v-for="logLine in logLines" :key="logLine.pos" class="flex items-center">
<div class="text-gray-500 text-sm w-4">{{ (logLine.pos || 0) + 1 }}</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="mx-4 text-gray-200 dark:text-gray-400" v-html="logLine.out" />
<div class="ml-auto text-gray-500 text-sm">{{ logLine.time || 0 }}s</div>
</div>
<div v-if="proc?.end_time !== undefined" class="text-gray-500 text-sm mt-4 ml-8">
exit code {{ proc.exit_code }}
</div>
<template v-if="!proc?.error">
<div v-for="logLine in logLines" :key="logLine.pos" class="flex items-center">
<div class="text-gray-500 text-sm w-4">{{ (logLine.pos || 0) + 1 }}</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="mx-4 text-gray-200 dark:text-gray-400" v-html="logLine.out" />
<div class="ml-auto text-gray-500 text-sm">{{ logLine.time || 0 }}s</div>
</div>
<div v-if="proc?.end_time !== undefined" class="text-gray-500 text-sm mt-4 ml-8">
exit code {{ proc.exit_code }}
</div>
</template>
<div class="text-gray-300 mx-auto">
<span v-if="proc?.error" class="text-red-500">{{ proc.error }}</span>

View File

@@ -35,11 +35,11 @@ export default () => {
return;
}
if (isProcFinished(_proc)) {
if (_proc.error) {
logs.value = undefined;
} else if (isProcFinished(_proc)) {
logs.value = await apiClient.getLogs(owner, repo, build, _proc.pid);
}
if (isProcRunning(_proc)) {
} else if (isProcRunning(_proc)) {
// load stream of parent process (which receives all child processes logs)
stream = apiClient.streamLogs(owner, repo, build, _proc.ppid, onLogsUpdate);
}