Skip to content

Commit

Permalink
use errors.New for string message
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Dec 29, 2024
1 parent 9b4fbf1 commit b3c38d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/xban.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package web

import (
"encoding/json"
"errors"
"fmt"
"mtui/bridge"
"mtui/types"
Expand All @@ -16,7 +17,7 @@ func SendLuaResponse(w http.ResponseWriter, err error, lr *command.LuaResponse)
if err != nil {
SendError(w, 500, err)
} else if !lr.Success {
SendError(w, 500, fmt.Errorf(lr.Message))
SendError(w, 500, errors.New(lr.Message))
} else {
Send(w, lr.Result, nil)
}
Expand Down

0 comments on commit b3c38d8

Please sign in to comment.