Skip to content

Commit afc594c

Browse files
committed
Add more logging to client
1 parent b1ce359 commit afc594c

File tree

1 file changed

+10
-0
lines changed
  • packages/app/src/app/overmind/effects/live

1 file changed

+10
-0
lines changed

packages/app/src/app/overmind/effects/live/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ class Live {
195195
});
196196

197197
this.socket.onClose(e => {
198+
captureException(
199+
new Error('Connection loss with live, reason: ' + e.code)
200+
);
201+
198202
if (e.code === 1006) {
199203
// This is an abrupt close, the server probably restarted or carshed. We don't want to overload
200204
// the server, so we manually wait and try to connect;
@@ -304,6 +308,12 @@ class Live {
304308
event === 'phx_error';
305309
const alteredEvent = disconnected ? 'connection-loss' : event;
306310

311+
if (event === 'phx_error') {
312+
captureException(
313+
new Error('Received phoenix error: ' + JSON.stringify(data))
314+
);
315+
}
316+
307317
const _isOwnMessage = Boolean(
308318
data && data._messageId && this.pendingMessages.delete(data._messageId)
309319
);

0 commit comments

Comments
 (0)