mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-24 06:27:09 +02:00
add system error.
This commit is contained in:
parent
9e466b08cc
commit
313cd55049
8 changed files with 34 additions and 11 deletions
|
@ -133,7 +133,7 @@ func (ws *WebSocketHandler) Upgrade(w http.ResponseWriter, r *http.Request) erro
|
|||
if err != nil {
|
||||
ws.logger.Warn().Err(err).Msg("authentication failed")
|
||||
|
||||
if err = connection.WriteJSON(message.Disconnect{
|
||||
if err = connection.WriteJSON(message.SystemMessage{
|
||||
Event: event.SYSTEM_DISCONNECT,
|
||||
Message: "invalid_password",
|
||||
}); err != nil {
|
||||
|
@ -160,7 +160,7 @@ func (ws *WebSocketHandler) Upgrade(w http.ResponseWriter, r *http.Request) erro
|
|||
}
|
||||
|
||||
if !ok {
|
||||
if err = connection.WriteJSON(message.Disconnect{
|
||||
if err = connection.WriteJSON(message.SystemMessage{
|
||||
Event: event.SYSTEM_DISCONNECT,
|
||||
Message: reason,
|
||||
}); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue