Skip to content

Commit

Permalink
Merge pull request #6 from RV-Argonaut/subscribe-err-codes
Browse files Browse the repository at this point in the history
Add subscription error codes to mid groups (RV develop)
  • Loading branch information
ferm10n authored Mar 29, 2023
2 parents 3a5c96e + 24d4fd7 commit 4433476
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/sessionControlClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,13 @@ class SessionControlClient extends EventEmitter {
return;
}

if (midGroupList[midGroup].subscribe === undefined) {
let err = new Error(`[Session Control Client] [Subscribe] subscribing to midGroup [${midGroup}] is not supported`);
debug("SessionControlClient _subscribe err_unsupported_midGroup");
cb(err);
return;
}

let mid = opts || {};

let type = SUBSCRIBE;
Expand Down Expand Up @@ -748,6 +755,13 @@ class SessionControlClient extends EventEmitter {
return;
}

if (midGroupList[midGroup].unsubscribe === undefined) {
let err = new Error(`[Session Control Client] [Unsubscribe] unsubscribing from midGroup [${midGroup}] is not supported`);
debug("SessionControlClient _unsubscribe err_unsupported_midGroup");
cb(err);
return;
}

if (cb === undefined) {
if (typeof opts === "function") {
cb = opts;
Expand Down

0 comments on commit 4433476

Please sign in to comment.