Skip to content

Commit

Permalink
add status message when launcher failed (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
VonnyJap authored Dec 24, 2024
1 parent 148c35f commit e597c78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,14 @@ func launchAction(api screwdriver.API, buildID int, rootDir, emitterPath, metaSp

err, sourceDir, launchShellBin := launch(api, buildID, rootDir, emitterPath, metaSpace, storeURI, uiURI, shellBin, buildTimeout, buildToken, cacheStrategy, pipelineCacheDir, jobCacheDir, eventCacheDir, cacheCompress, cacheMd5Check, isLocal, cacheMaxSizeInMB, cacheMaxGoThreads)
if err != nil {
if _, ok := err.(executor.ErrStatus); ok {
log.Printf("Failure due to non-zero exit code: %v\n", err)
} else {
log.Printf("Error running launcher: %v\n", err)
var errMsg string
errMsg = fmt.Sprintf("Error running launcher: %v", err)
if statusErr, ok := err.(executor.ErrStatus); ok {
errMsg = fmt.Sprintf("Error running launcher due to non-zero exit code: %v", statusErr)
}
log.Println(errMsg)

prepareExit(screwdriver.Failure, buildID, api, metaSpace, "")
prepareExit(screwdriver.Failure, buildID, api, metaSpace, errMsg)
TerminateSleep(launchShellBin, sourceDir, true)
cleanExit()
return nil
Expand Down

0 comments on commit e597c78

Please sign in to comment.