Permalink
Browse files

Added support for per notification error callbacks.

  • Loading branch information...
1 parent 3f87814 commit 2ad7e60a5098fc3c4ecf7121287d8573bc808ca1 Randall Tombaugh committed Oct 16, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/connection.js
View
4 lib/connection.js
@@ -333,7 +333,9 @@ Connection.prototype.handleTransmissionError = function (data) {
*/
Connection.prototype.raiseError = function(errorCode, notification) {
debug("Raising error:", errorCode, notification);
- if (typeof this.options.errorCallback == 'function') {
+ if (notification && typeof notification.errorCallback == 'function' ) {
+ notification.errorCallback(errorCode);
+ } else if (typeof this.options.errorCallback == 'function') {
this.options.errorCallback(errorCode, notification);
}
};

0 comments on commit 2ad7e60

Please sign in to comment.