Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Jun 10, 2014
1 parent 1f1cb34 commit d732e05
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions package/lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ Connection.prototype.open = function () {

self._session.onjoin = function (details) {
if (self.onopen) {
self.onopen(self._session, details);
try {
self.onopen(self._session, details);
} catch (e) {
log.debug("Exception raised from app code while firing Connection.onopen()", e);
}
}
};

Expand Down Expand Up @@ -222,7 +226,11 @@ Connection.prototype.open = function () {
reason: self._session_close_reason,
message: self._session_close_message
};
stop_retrying = self.onclose(reason, details);
try {
stop_retrying = self.onclose(reason, details);
} catch (e) {
log.debug("Exception raised from app code while firing Connection.onclose()", e);
}
}

if (self._session) {
Expand Down

0 comments on commit d732e05

Please sign in to comment.