Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
better error handling for receiving messages
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jan 27, 2022
1 parent dc2f218 commit 9ce24f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions crayfish/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ func (c *CrayfishInstance) HandleEnvelope(msg []byte) (*CrayfishWebSocketRespons
log.Debugf("[textsecure-crayfish-ws] HandleEnvelope recieved an response")
rm, err := json.Marshal(response.Message)
if err != nil {
log.Errorln("[textsecure-crayfish-ws] failed to marshal response message", response.Message)
return nil, err
}
var data CrayfishWebSocketResponse_HANDLE_ENVELOPE_MESSAGE
Expand Down
9 changes: 7 additions & 2 deletions websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,14 @@ func StartListening() error {
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Error("[textsecure] Failed to handle received message")
}).Error("[textsecure] Failed to decrypt received message")
} else {
env, _ := createEnvelope(plaintext)
env, err := createEnvelope(plaintext)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Error("[textsecure] Failed to create envelope")
}
err = handleReceivedMessage(env)
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit 9ce24f5

Please sign in to comment.