Skip to content

Commit

Permalink
Update root.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPates committed Nov 7, 2022
1 parent 8275c09 commit 8b089ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
cpl := codepipeline.New(s)
if err != nil {
// notify codepipeline and mark its job execution as Failure
log.Fatal("Notifying CodePipeline and mark its job execution as Failure")
log.Fatalf(errors.Wrap(err, ("Notifying CodePipeline and mark its job execution as Failure").Error())
jobID := event.CodePipelineJob.ID
if len(jobID) == 0 {
panic("CodePipeline Job ID is not set")
Expand All @@ -99,7 +99,7 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
}
_, cplErr := cpl.PutJobFailureResult(cplFailure)
if cplErr != nil {
log.Fatal("Failed to update CodePipeline jobID %s status with: %s", jobID, cplErr.Error())
log.Fatalf(errors.Wrap(err, "Failed to update CodePipeline jobID status").Error())
}
return "Failure", err
}
Expand All @@ -114,7 +114,7 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
}
_, cplErr := cpl.PutJobSuccessResult(cplSuccess)
if cplErr != nil {
log.Fatal("Failed to update CodePipeline jobID %s status with: %s", jobID, cplErr.Error())
log.Fatalf(errors.Wrap(err, "Failed to update CodePipeline jobID status").Error())
}
return "Success", nil
}
Expand Down

0 comments on commit 8b089ac

Please sign in to comment.