@@ -17,7 +17,6 @@ import {
17
17
import { ulid } from 'ulid'
18
18
19
19
import { Name } from '~/models/Analytics'
20
- import { ErrorLevel } from '~/models/ErrorReporting'
21
20
import { ID } from '~/models/Identifiers'
22
21
import { Status } from '~/models/Status'
23
22
import { getAccountUser , getUserId } from '~/store/account/selectors'
@@ -122,11 +121,10 @@ function* doFetchUnreadMessagesCount() {
122
121
fetchUnreadMessagesCountSucceeded ( { unreadMessagesCount : response . data } )
123
122
)
124
123
} catch ( e ) {
125
- console . error ( 'fetchUnreadMessagesCountFailed' , e )
126
124
yield * put ( fetchUnreadMessagesCountFailed ( ) )
127
125
const reportToSentry = yield * getContext ( 'reportToSentry' )
128
126
reportToSentry ( {
129
- level : ErrorLevel . Error ,
127
+ name : 'Chats' ,
130
128
error : e as Error
131
129
} )
132
130
}
@@ -170,11 +168,10 @@ function* doFetchLatestChats() {
170
168
} )
171
169
)
172
170
} catch ( e ) {
173
- console . error ( 'fetchLatestChatsFailed' , e )
174
171
yield * put ( fetchMoreChatsFailed ( ) )
175
172
const reportToSentry = yield * getContext ( 'reportToSentry' )
176
173
reportToSentry ( {
177
- level : ErrorLevel . Error ,
174
+ name : 'Chats' ,
178
175
error : e as Error
179
176
} )
180
177
}
@@ -198,11 +195,10 @@ function* doFetchMoreChats() {
198
195
yield * fetchUsersForChats ( response . data )
199
196
yield * put ( fetchMoreChatsSucceeded ( response ) )
200
197
} catch ( e ) {
201
- console . error ( 'fetchMoreChatsFailed' , e )
202
198
yield * put ( fetchMoreChatsFailed ( ) )
203
199
const reportToSentry = yield * getContext ( 'reportToSentry' )
204
200
reportToSentry ( {
205
- level : ErrorLevel . Error ,
201
+ name : 'Chats' ,
206
202
error : e as Error
207
203
} )
208
204
}
@@ -263,11 +259,10 @@ function* doFetchLatestMessages(
263
259
} )
264
260
)
265
261
} catch ( e ) {
266
- console . error ( 'fetchLatestChatMessagesFailed' , e )
267
262
yield * put ( fetchMoreMessagesFailed ( { chatId } ) )
268
263
const reportToSentry = yield * getContext ( 'reportToSentry' )
269
264
reportToSentry ( {
270
- level : ErrorLevel . Error ,
265
+ name : 'Chats' ,
271
266
error : e as Error ,
272
267
additionalInfo : {
273
268
chatId
@@ -325,11 +320,10 @@ function* doFetchMoreMessages(action: ReturnType<typeof fetchMoreMessages>) {
325
320
} )
326
321
)
327
322
} catch ( e ) {
328
- console . error ( 'fetchMoreChatMessagesFailed' , e )
329
323
yield * put ( fetchMoreMessagesFailed ( { chatId } ) )
330
324
const reportToSentry = yield * getContext ( 'reportToSentry' )
331
325
reportToSentry ( {
332
- level : ErrorLevel . Error ,
326
+ name : 'Chats' ,
333
327
error : e as Error ,
334
328
additionalInfo : {
335
329
chatId
@@ -373,11 +367,10 @@ function* doSetMessageReaction(action: ReturnType<typeof setMessageReaction>) {
373
367
} )
374
368
)
375
369
} catch ( e ) {
376
- console . error ( 'setMessageReactionFailed' , e )
377
370
yield * put ( setMessageReactionFailed ( action . payload ) )
378
371
const reportToSentry = yield * getContext ( 'reportToSentry' )
379
372
reportToSentry ( {
380
- level : ErrorLevel . Error ,
373
+ name : 'Chats' ,
381
374
error : e as Error ,
382
375
additionalInfo : {
383
376
chatId,
@@ -435,7 +428,6 @@ function* doCreateChat(action: ReturnType<typeof createChat>) {
435
428
yield * call ( track , make ( { eventName : Name . CREATE_CHAT_SUCCESS } ) )
436
429
}
437
430
} catch ( e ) {
438
- console . error ( 'createChatFailed' , e )
439
431
yield * put (
440
432
toast ( {
441
433
type : 'error' ,
@@ -444,7 +436,7 @@ function* doCreateChat(action: ReturnType<typeof createChat>) {
444
436
)
445
437
const reportToSentry = yield * getContext ( 'reportToSentry' )
446
438
reportToSentry ( {
447
- level : ErrorLevel . Error ,
439
+ name : 'Chats' ,
448
440
error : e as Error ,
449
441
additionalInfo : {
450
442
userIds
@@ -512,7 +504,6 @@ function* doCreateChatBlast(action: ReturnType<typeof createChatBlast>) {
512
504
)
513
505
}
514
506
} catch ( e ) {
515
- console . error ( 'createChatBlastFailed' , e )
516
507
yield * put (
517
508
toast ( {
518
509
type : 'error' ,
@@ -521,7 +512,7 @@ function* doCreateChatBlast(action: ReturnType<typeof createChatBlast>) {
521
512
)
522
513
const reportToSentry = yield * getContext ( 'reportToSentry' )
523
514
reportToSentry ( {
524
- level : ErrorLevel . Error ,
515
+ name : 'Chats' ,
525
516
error : e as Error ,
526
517
additionalInfo : {
527
518
audience,
@@ -567,11 +558,10 @@ function* doMarkChatAsRead(action: ReturnType<typeof markChatAsRead>) {
567
558
yield * put ( markChatAsReadFailed ( { chatId } ) )
568
559
}
569
560
} catch ( e ) {
570
- console . error ( 'markChatAsReadFailed' , e )
571
561
yield * put ( markChatAsReadFailed ( { chatId } ) )
572
562
const reportToSentry = yield * getContext ( 'reportToSentry' )
573
563
reportToSentry ( {
574
- level : ErrorLevel . Error ,
564
+ name : 'Chats' ,
575
565
error : e as Error ,
576
566
additionalInfo : {
577
567
chatId
@@ -637,7 +627,6 @@ function* doSendMessage(action: ReturnType<typeof sendMessage>) {
637
627
}
638
628
yield * call ( track , make ( { eventName : Name . SEND_MESSAGE_SUCCESS } ) )
639
629
} catch ( e ) {
640
- console . error ( 'sendMessageFailed' , e )
641
630
yield * put ( sendMessageFailed ( { chatId, messageId : messageIdToUse } ) )
642
631
643
632
// Fetch the chat to see if permissions need rechecking
@@ -658,7 +647,7 @@ function* doSendMessage(action: ReturnType<typeof sendMessage>) {
658
647
}
659
648
const reportToSentry = yield * getContext ( 'reportToSentry' )
660
649
reportToSentry ( {
661
- level : ErrorLevel . Error ,
650
+ name : 'Chats' ,
662
651
error : e as Error ,
663
652
additionalInfo : {
664
653
chatId,
@@ -700,10 +689,9 @@ function* doFetchBlockees() {
700
689
} )
701
690
)
702
691
} catch ( e ) {
703
- console . error ( 'fetchBlockeesFailed' , e )
704
692
const reportToSentry = yield * getContext ( 'reportToSentry' )
705
693
reportToSentry ( {
706
- level : ErrorLevel . Error ,
694
+ name : 'Chats' ,
707
695
error : e as Error
708
696
} )
709
697
}
@@ -722,10 +710,9 @@ function* doFetchBlockers() {
722
710
} )
723
711
)
724
712
} catch ( e ) {
725
- console . error ( 'fetchBlockersFailed' , e )
726
713
const reportToSentry = yield * getContext ( 'reportToSentry' )
727
714
reportToSentry ( {
728
- level : ErrorLevel . Error ,
715
+ name : 'Chats' ,
729
716
error : e as Error
730
717
} )
731
718
}
@@ -746,10 +733,9 @@ function* doBlockUser(action: ReturnType<typeof blockUser>) {
746
733
make ( { eventName : Name . BLOCK_USER_SUCCESS , blockedUserId : userId } )
747
734
)
748
735
} catch ( e ) {
749
- console . error ( 'blockUserFailed' , e )
750
736
const reportToSentry = yield * getContext ( 'reportToSentry' )
751
737
reportToSentry ( {
752
- level : ErrorLevel . Error ,
738
+ name : 'Chats' ,
753
739
error : e as Error
754
740
} )
755
741
yield * call (
@@ -768,10 +754,9 @@ function* doUnblockUser(action: ReturnType<typeof unblockUser>) {
768
754
} )
769
755
yield * put ( fetchBlockees ( ) )
770
756
} catch ( e ) {
771
- console . error ( 'unblockUserFailed' , e )
772
757
const reportToSentry = yield * getContext ( 'reportToSentry' )
773
758
reportToSentry ( {
774
- level : ErrorLevel . Error ,
759
+ name : 'Chats' ,
775
760
error : e as Error
776
761
} )
777
762
}
@@ -800,10 +785,9 @@ function* doFetchPermissions(action: ReturnType<typeof fetchPermissions>) {
800
785
} )
801
786
)
802
787
} catch ( e ) {
803
- console . error ( 'fetchPermissionsFailed' , e )
804
788
const reportToSentry = yield * getContext ( 'reportToSentry' )
805
789
reportToSentry ( {
806
- level : ErrorLevel . Error ,
790
+ name : 'Chats' ,
807
791
error : e as Error
808
792
} )
809
793
}
@@ -829,10 +813,9 @@ function* doFetchLinkUnfurlMetadata(
829
813
fetchLinkUnfurlSucceeded ( { chatId, messageId, unfurlMetadata : data [ 0 ] } )
830
814
)
831
815
} catch ( e ) {
832
- console . error ( 'fetchUnfurlFailed' , e )
833
816
const reportToSentry = yield * getContext ( 'reportToSentry' )
834
817
reportToSentry ( {
835
- level : ErrorLevel . Error ,
818
+ name : 'Chats' ,
836
819
error : e as Error ,
837
820
additionalInfo : {
838
821
chatId,
@@ -860,10 +843,9 @@ function* doDeleteChat(action: ReturnType<typeof deleteChat>) {
860
843
yield * put ( deleteChatSucceeded ( { chatId } ) )
861
844
yield * call ( track , make ( { eventName : Name . DELETE_CHAT_SUCCESS } ) )
862
845
} catch ( e ) {
863
- console . error ( 'deleteChat failed' , e , { chatId } )
864
846
const reportToSentry = yield * getContext ( 'reportToSentry' )
865
847
reportToSentry ( {
866
- level : ErrorLevel . Error ,
848
+ name : 'Chats' ,
867
849
error : e as Error ,
868
850
additionalInfo : {
869
851
chatId
@@ -878,7 +860,7 @@ function* doLogError({ payload: { error } }: ReturnType<typeof logError>) {
878
860
const reportToSentry = yield * getContext ( 'reportToSentry' )
879
861
const { code, url } = error
880
862
reportToSentry ( {
881
- level : ErrorLevel . Error ,
863
+ name : 'Chats' ,
882
864
error,
883
865
additionalInfo : {
884
866
code,
0 commit comments