Skip to content

AzureCI and GitLabCI don't have Panic Recovery like GithubCI and BitbucketCI #768

@ajaxian79

Description

@ajaxian79

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions