mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
Extract JSON error instead of re-encoding it
This commit is contained in:
parent
ad1296e0ed
commit
537800956a
1 changed files with 5 additions and 9 deletions
|
@ -439,14 +439,6 @@ type bunchSubscriberList struct {
|
|||
Members []bunchSubscriber
|
||||
}
|
||||
|
||||
type cacheStatus byte
|
||||
|
||||
const (
|
||||
CacheStatusNotFound = iota
|
||||
CacheStatusFound
|
||||
CacheStatusExpired
|
||||
)
|
||||
|
||||
var bunchGroup singleflight.Group
|
||||
|
||||
// C2SHandleBunchedCommand handles C2S Commands such as `get_link`.
|
||||
|
@ -465,7 +457,11 @@ func C2SHandleBunchedCommand(conn *websocket.Conn, client *ClientInfo, msg Clien
|
|||
reply.MessageID = msg.MessageID
|
||||
if result.Err != nil {
|
||||
reply.Command = ErrorCommand
|
||||
if efb, ok := result.Err.(ErrForwardedFromBackend); ok {
|
||||
reply.Arguments = efb.JSONError
|
||||
} else {
|
||||
reply.Arguments = result.Err.Error()
|
||||
}
|
||||
} else {
|
||||
reply.Command = SuccessCommand
|
||||
reply.origArguments = result.Val.(string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue