Skip to content
Browse files

Fix incorrect re-throwing of error condition.

This was passing a cons cell as the first argument to `error', which
expects a format string and thus throws an error itself.  Use the
re-throw idiom suggested by
http://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html#index-condition_002dcase-578
instead.

NB: at first glance, `(error (cdr err))' is preferable as it is more
succinct.  However, the generic form will keep working should the
CONDITION-NAME in the condition-case form ever be changed.
  • Loading branch information...
1 parent aeda944 commit 8513a7e38d7bf3538d235668ec16081cbd561460 @jscheid jscheid committed Aug 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 websocket.el
View
2 websocket.el
@@ -582,7 +582,7 @@ connection is invalid, the connection will be closed."
(websocket-verify-headers websocket text))
(error
(websocket-close websocket)
- (error err)))
+ (signal (car err) (cdr err))))
(setf (websocket-ready-state websocket) 'open)
(websocket-try-callback 'websocket-on-open 'on-open websocket))
(when (eq 'open (websocket-ready-state websocket))

0 comments on commit 8513a7e

Please sign in to comment.
Something went wrong with that request. Please try again.