Skip to content
Browse files

dgram: make addMembership() and dropMembership() conform to v0.4 API

- throw on error, don't return an error code
  • Loading branch information...
1 parent fc6a967 commit 6999fb3d1e342cc5bcd41c5ff41ff0c88ddfb250 @bnoordhuis bnoordhuis committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/dgram.js
View
8 lib/dgram.js
@@ -260,7 +260,9 @@ Socket.prototype.addMembership = function(multicastAddress,
throw new Error('multicast address must be specified');
}
- return this._handle.addMembership(multicastAddress, interfaceAddress);
+ if (this._handle.addMembership(multicastAddress, interfaceAddress)) {
+ throw new errnoException(errno, 'addMembership');
+ }
};
@@ -272,7 +274,9 @@ Socket.prototype.dropMembership = function(multicastAddress,
throw new Error('multicast address must be specified');
}
- return this._handle.dropMembership(multicastAddress, interfaceAddress);
+ if (this._handle.dropMembership(multicastAddress, interfaceAddress)) {
+ throw new errnoException(errno, 'dropMembership');
+ }
};

0 comments on commit 6999fb3

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