Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add unit tests for engine exec #180

Merged
merged 11 commits into from
Aug 8, 2022
Prev Previous commit
Next Next commit
refactor: variable renaming in engine exec
  • Loading branch information
shay2025 committed Aug 8, 2022
commit f6bed8cfe2e553ec84a66fc0ef6e57a051db66ee
8 changes: 4 additions & 4 deletions engine/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ func execLog(val string) {
}

func CollectError(env *Env, err error) {
var errDetails string
var errMsg string
ghError, isGitHubError := err.(*github.ErrorResponse)

if isGitHubError {
errDetails = ghError.Message
errMsg = ghError.Message
} else {
errDetails = err.Error()
errMsg = err.Error()
}

env.Collector.Collect("Error", map[string]interface{}{
"pullRequestUrl": env.PullRequest.URL,
"details": errDetails,
"details": errMsg,
})
}

Expand Down