|
|
@@ -78,11 +78,20 @@ func (c *EnablePullRequestHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
|
|
|
|
|
|
if ghResp != nil {
|
|
|
if ghResp.StatusCode == 404 {
|
|
|
- c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(fmt.Errorf("workflow file not found"), 404))
|
|
|
+ c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(
|
|
|
+ fmt.Errorf(
|
|
|
+ "Please make sure the preview environment workflow files are present in PR branch %s and are up to"+
|
|
|
+ " date with the default branch", request.BranchFrom,
|
|
|
+ ), 404),
|
|
|
+ )
|
|
|
return
|
|
|
} else if ghResp.StatusCode == 422 {
|
|
|
c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(
|
|
|
- fmt.Errorf("please make sure the workflow file in branch %s is up to date", request.BranchFrom), 422))
|
|
|
+ fmt.Errorf(
|
|
|
+ "Please make sure the workflow files in PR branch %s are up to date with the default branch",
|
|
|
+ request.BranchFrom,
|
|
|
+ ), 422),
|
|
|
+ )
|
|
|
return
|
|
|
}
|
|
|
}
|