Report chat errors to telemetry (#105)

This commit is contained in:
Brian Hackett 2025-04-15 10:11:55 -07:00 committed by GitHub
parent 8ea104c6cc
commit cb417d8384
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -474,6 +474,7 @@ export const ChatImpl = memo((props: ChatProps) => {
onStatus: onChatStatus,
});
} catch (e) {
toast.error('Error resuming chat');
console.error('Error resuming chat', e);
}

View File

@ -1,3 +1,4 @@
import { pingTelemetry } from '../hooks/pingTelemetry';
import { createInjectableFunction } from './injectable';
const replayWsServer = 'wss://dispatch.replay.io';
@ -181,6 +182,7 @@ export class ProtocolClient {
if (result) {
info.deferred.resolve(result);
} else if (error) {
pingTelemetry('ProtocolError', { method: info.method, error });
console.error('ProtocolError', info.method, id, error);
info.deferred.reject(new ProtocolError(error));
} else {