Skip to content

Commit 46868ae

Browse files
committed
Log OperationFailure
1 parent b128cd9 commit 46868ae

File tree

1 file changed

+16
-6
lines changed
  • packages/app/src/app/overmind/effects/live

1 file changed

+16
-6
lines changed

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import { TextOperation } from 'ot';
1010
import { Socket, Channel } from 'phoenix';
1111
import uuid from 'uuid';
1212

13-
import { logBreadcrumb } from '@codesandbox/common/lib/utils/analytics/sentry';
13+
import {
14+
logBreadcrumb,
15+
captureException,
16+
} from '@codesandbox/common/lib/utils/analytics/sentry';
1417
import clientsFactory from './clients';
1518
import { OPTIMISTIC_ID_PREFIX } from '../utils';
1619

@@ -55,11 +58,16 @@ export default new (class Live {
5558
})}`,
5659
});
5760

58-
return live.send('operation', {
59-
moduleShortid,
60-
operation,
61-
revision,
62-
});
61+
return live
62+
.send('operation', {
63+
moduleShortid,
64+
operation,
65+
revision,
66+
})
67+
.catch(e => {
68+
e.name = 'OperationFailure';
69+
captureException(e);
70+
});
6371
},
6472
(moduleShortid, operation) => {
6573
options.onApplyOperation({
@@ -233,6 +241,8 @@ export default new (class Live {
233241
try {
234242
clients.get(moduleShortid).applyClient(operation);
235243
} catch (e) {
244+
e.name = 'OperationFailure';
245+
captureException(e);
236246
// Something went wrong, probably a sync mismatch. Request new version
237247
this.send('live:module_state', {});
238248
}

0 commit comments

Comments
 (0)