branch: externals/websocket
commit 0591322dc9e311f73270279a51b0bbf8b47d4f9c
Author: Andrew Hyatt <ahy...@gmail.com>
Commit: Andrew Hyatt <ahy...@gmail.com>

    Fix error handling during connection.
    
    Instead of throwing errors, we should be handling them with 
websocket-on-error.
---
 websocket.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/websocket.el b/websocket.el
index 860cf2e2cd..4ffb39d96d 100644
--- a/websocket.el
+++ b/websocket.el
@@ -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)))

Reply via email to