Skip to content

Commit

Permalink
handle error so template JS could check
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Nov 28, 2019
1 parent cad5add commit 0e406a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,8 @@ func ChangeIssueReaction(ctx *context.Context, form auth.ReactionForm) {
switch ctx.Params(":action") {
case "react":
if !util.IsStringInSlice(form.Content, setting.UI.Reactions) {
log.Error("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
err := fmt.Errorf("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
ctx.ServerError(err.Error(), err)
return
}

Expand Down Expand Up @@ -1549,7 +1550,8 @@ func ChangeCommentReaction(ctx *context.Context, form auth.ReactionForm) {
switch ctx.Params(":action") {
case "react":
if !util.IsStringInSlice(form.Content, setting.UI.Reactions) {
log.Error("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
err := fmt.Errorf("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
ctx.ServerError(err.Error(), err)
return
}

Expand Down

0 comments on commit 0e406a7

Please sign in to comment.