File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ export abstract class Channel {
32
32
abstract stopListening ( event : string ) : Channel ;
33
33
34
34
/**
35
- * Stop listening for a whispser event on the channel instance.
35
+ * Stop listening for a whisper event on the channel instance.
36
36
*/
37
37
stopListeningForWhisper ( event : string ) : Channel {
38
38
return this . stopListening ( '.client-' + event ) ;
39
39
}
40
+
41
+ /**
42
+ * Register a callback to be called anytime an error occurs.
43
+ */
44
+ abstract error ( callback : Function ) : Channel ;
40
45
}
Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ export class NullChannel extends Channel {
32
32
return this ;
33
33
}
34
34
35
+ /**
36
+ * Register a callback to be called anytime an error occurs.
37
+ */
38
+ error ( callback : Function ) : NullChannel {
39
+ return this ;
40
+ }
41
+
35
42
/**
36
43
* Bind a channel to an event.
37
44
*/
Original file line number Diff line number Diff line change 1
- import { EventFormatter } from './. ./util' ;
1
+ import { EventFormatter } from '../util' ;
2
2
import { Channel } from './channel' ;
3
3
4
4
/**
@@ -76,6 +76,17 @@ export class PusherChannel extends Channel {
76
76
return this ;
77
77
}
78
78
79
+ /**
80
+ * Register a callback to be called anytime a subscription error occurs.
81
+ */
82
+ error ( callback : Function ) : PusherChannel {
83
+ this . on ( 'pusher:subscription_error' , ( status ) => {
84
+ callback ( status ) ;
85
+ } ) ;
86
+
87
+ return this ;
88
+ }
89
+
79
90
/**
80
91
* Bind a channel to an event.
81
92
*/
Original file line number Diff line number Diff line change 1
- import { EventFormatter } from './. ./util' ;
1
+ import { EventFormatter } from '../util' ;
2
2
import { Channel } from './channel' ;
3
3
4
4
/**
@@ -87,6 +87,13 @@ export class SocketIoChannel extends Channel {
87
87
return this ;
88
88
}
89
89
90
+ /**
91
+ * Register a callback to be called anytime an error occurs.
92
+ */
93
+ error ( callback : Function ) : SocketIoChannel {
94
+ return this ;
95
+ }
96
+
90
97
/**
91
98
* Bind the channel's socket to an event and store the callback.
92
99
*/
You can’t perform that action at this time.
0 commit comments