Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subscription error codes to mid groups (RV develop) #6

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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