Skip to content

Commit

Permalink
Added another user-facing error for staged commits and a fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Nov 14, 2023
1 parent 52dc826 commit 303cdaf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/runners/packages/rationalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,25 @@ func rationalizeError(auth *authentication.Auth, err *error) {
errs.SetInput(),
errs.SetTips(locale.T("tip_private_project_auth")),
)
case bpModel.ForbiddenErrorType:
*err = errs.WrapUserFacing(*err,
locale.Tl("err_packages_forbidden", "Could not make runtime changes because you do not have permission to do so."),
errs.SetInput(),
errs.SetTips(locale.T("tip_private_project_auth")),
)
case bpModel.HeadOnBranchMovedErrorType:
*err = errs.WrapUserFacing(*err,
locale.T("err_buildplanner_head_on_branch_moved"),
errs.SetInput(),
)
case bpModel.NoChangeSinceLastCommitErrorType:
*err = errs.WrapUserFacing(*err,
locale.Tl("err_packages_exists", "That package is already installed"),
locale.Tl("err_packages_exists", "That package is already installed."),
errs.SetInput(),
)
default:
*err = errs.WrapUserFacing(*err,
locale.Tl("err_packages_buildplanner_error", "Could not make runtime changes due to the following error: {{.V0}}", commitError.Message),
errs.SetInput(),
)
}
Expand Down

0 comments on commit 303cdaf

Please sign in to comment.