Skip to content

Commit 0e406a7

Browse files
committed
handle error so template JS could check
1 parent cad5add commit 0e406a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

routers/repo/issue.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,8 @@ func ChangeIssueReaction(ctx *context.Context, form auth.ReactionForm) {
14491449
switch ctx.Params(":action") {
14501450
case "react":
14511451
if !util.IsStringInSlice(form.Content, setting.UI.Reactions) {
1452-
log.Error("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
1452+
err := fmt.Errorf("ChangeIssueReaction: '%s' is not an allowed reaction", form.Content)
1453+
ctx.ServerError(err.Error(), err)
14531454
return
14541455
}
14551456

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

0 commit comments

Comments
 (0)