Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan McKinley
9268d3e14e Merge remote-tracking branch 'origin/main' into live-error-handling 2025-11-20 17:07:26 +03:00
Ryan McKinley
c28daa3ace live error handling 2025-10-16 09:16:12 +03:00

View File

@@ -3,6 +3,7 @@ import {
ConnectedContext,
ConnectingContext,
DisconnectedContext,
ErrorContext,
ServerPublicationContext,
State,
} from 'centrifuge';
@@ -106,12 +107,19 @@ export class CentrifugeService implements CentrifugeSrv {
this.centrifuge.on('connecting', this.onDisconnect);
this.centrifuge.on('disconnected', this.onDisconnect);
this.centrifuge.on('publication', this.onServerSideMessage);
this.centrifuge.on('error', this.onError);
}
//----------------------------------------------------------
// Internal functions
//----------------------------------------------------------
private onError = (context: ErrorContext) => {
// TODO?? when 401 error, we either need to show a clear error message
// or redirect to the /login page
console.warn('Grafana Live ERROR', context);
};
private onConnect = (context: ConnectedContext) => {
this.connectionState.next(true);
};