File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
packages/app/src/app/overmind/effects/live Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ import { TextOperation } from 'ot';
1010import { Socket , Channel } from 'phoenix' ;
1111import 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' ;
1417import clientsFactory from './clients' ;
1518import { 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 }
You can’t perform that action at this time.
0 commit comments