Skip to content

Commit

Permalink
Fix error handling during connection.
Browse files Browse the repository at this point in the history
Instead of throwing errors, we should be handling them with websocket-on-error.
  • Loading branch information
ahyatt committed Apr 6, 2019
1 parent d34f5f0 commit 0591322
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion websocket.el
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ connection is invalid, the connection will be closed."
(websocket-process-headers (websocket-url websocket) text))
(error
(websocket-close websocket)
(signal (car err) (cdr err))))
(funcall (websocket-on-error websocket)
websocket 'on-open err)))
(setf (websocket-ready-state websocket) 'open)
(websocket-try-callback 'websocket-on-open 'on-open websocket))
(setf (websocket-inflight-input websocket) text)))
Expand Down

0 comments on commit 0591322

Please sign in to comment.