Of the four supported CI tools only Github and Bitbucket have code that recovers from a panic, for example from GitHub CI
defer func() {
if r := recover(); r != nil {
log.Println(fmt.Sprintf("stacktrace from panic: \n" + string(debug.Stack())))
err := usage.SendLogRecord(githubActor, fmt.Sprintf("Panic occurred. %s", r))
if err != nil {
log.Printf("Failed to send log record. %s\n", err)
}
os.Exit(1)
}
}()
It would be great if this could be written in a manner that makes it not only support all existing CIs but also as new CIs are added this change could cover those as well.
I am going to take a stab at solving this issue myself and submitting the fix as a PR.