Skip to content

Commit

Permalink
[DDO-3289] Improve error text in deploy hook test routes (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-r-warren authored Nov 3, 2023
1 parent 4f061b8 commit 4047f8a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func githubActionsDeployHooksV3TestRun(ctx *gin.Context) {
*hook.GithubActionsWorkflowPath,
*hook.GithubActionsDefaultRef,
workflowInputs); err != nil {
errors.AbortRequest(ctx, err)
errors.AbortRequest(ctx, fmt.Errorf("error between Sherlock and GitHub: %w", err))
return
}
ctx.JSON(http.StatusOK, GithubActionsDeployHookTestRunResponse{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (s *handlerSuite) TestGithubActionsDeployHooksV3TestRun() {
GithubActionsDeployHookTestRunRequest{Execute: utils.PointerTo(true)}),
&got)
s.Equal(http.StatusBadRequest, code)
s.Equal(errors.BadRequest, got.Message)
s.Equal(fmt.Sprintf("error between Sherlock and GitHub: %s", errors.BadRequest), got.Message)
})
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func slackDeployHooksV3TestRun(ctx *gin.Context) {
}
if err = slack.SendMessageReturnError(ctx, *hook.SlackChannel,
fmt.Sprintf("This is a deploy hook test message from Beehive, triggered by %s", user.SlackReference())); err != nil {
errors.AbortRequest(ctx, err)
errors.AbortRequest(ctx, fmt.Errorf("error between Sherlock and Slack: %w", err))
return
}
ctx.JSON(http.StatusOK, SlackDeployHookTestRunResponse{OK: true})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *handlerSuite) TestSlackDeployHooksV3TestRun() {
SlackDeployHookTestRunRequest{Execute: utils.PointerTo(true)}),
&got)
s.Equal(http.StatusBadRequest, code)
s.Equal(errors.BadRequest, got.Message)
s.Equal(fmt.Sprintf("error between Sherlock and Slack: %s", errors.BadRequest), got.Message)
})
})
}

0 comments on commit 4047f8a

Please sign in to comment.