Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.

Commit cc5c9ee

Browse files
committed
fix(errors): added missing 4xxx errors
1 parent 432934f commit cc5c9ee

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

src/errors.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,61 @@ export namespace InteractiveError {
409409
}
410410
errors[4022] = ChannelNotInteractive;
411411

412+
/**
413+
* BundleMissing occurs when the custom control bundle this session is trying to use has been unpublished or deleted.
414+
*/
415+
export class BundleMissing extends Base {
416+
constructor(message: string) {
417+
super(message, 4023);
418+
BundleMissing.setProto(this);
419+
}
420+
}
421+
errors[4023] = BundleMissing;
422+
423+
/**
424+
* Occurs when an Invalid broadcast scope is provided to `broadcastEvent`
425+
*/
426+
export class InvalidBroadcastScope extends Base {
427+
constructor(message: string) {
428+
super(message, 4024);
429+
InvalidBroadcastScope.setProto(this);
430+
}
431+
}
432+
errors[4024] = InvalidBroadcastScope;
433+
434+
/**
435+
* Occurs when your access to the session is revoked for example when you are banned.
436+
*/
437+
export class AccessRevocation extends Base {
438+
constructor(message: string) {
439+
super(message, 4025);
440+
AccessRevocation.setProto(this);
441+
}
442+
}
443+
errors[4025] = AccessRevocation;
444+
445+
/**
446+
* Occurs when an anonymous user tries to use a button that requires sparks.
447+
*/
448+
export class LoginRequired extends Base {
449+
constructor(message: string) {
450+
super(message, 4026);
451+
LoginRequired.setProto(this);
452+
}
453+
}
454+
errors[4026] = LoginRequired;
455+
456+
/**
457+
* Sent when the server has terminated your session. You should not try to reconnect.
458+
*/
459+
export class Terminated extends Base {
460+
constructor(message: string) {
461+
super(message, 4027);
462+
Terminated.setProto(this);
463+
}
464+
}
465+
errors[4027] = Terminated;
466+
412467
/**
413468
* Indicates input sent from a participant is invalid.
414469
*/

src/wire/Socket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class InteractiveSocket extends EventEmitter {
137137
// If this close event's code is an application error (e.g. bad authentication)
138138
// or invalid status code (for Edge), we raise it as an error and refuse to
139139
// reconnect.
140-
if (evt.code < 1000 || evt.code > 1999 || evt.code === 1005 || evt.code === 4025) {
140+
if (evt.code < 1000 || evt.code > 1999 || evt.code === 1005 || evt.code === 4027) {
141141
const err = InteractiveError.fromSocketMessage({
142142
code: evt.code,
143143
message: evt.reason,

0 commit comments

Comments
 (0)