@@ -6,12 +6,6 @@ import {
66 setQuartzIdentity ,
77 setQuartzIdentityStatus ,
88} from 'src/identity/actions/creators'
9- import { notify } from 'src/shared/actions/notifications'
10- import {
11- updateBillingFailed ,
12- updateIdentityFailed ,
13- updateOrgFailed ,
14- } from 'src/shared/copy/notifications'
159
1610// Types
1711import { RemoteDataState , GetState , NotificationAction } from 'src/types'
@@ -33,7 +27,13 @@ import {isFlagEnabled} from 'src/shared/utils/featureFlag'
3327// Thunks
3428import { getQuartzMeThunk } from 'src/me/actions/thunks'
3529
36- export const getQuartzIdentityThunk = ( ) => async dispatch => {
30+ // Error Reporting
31+ import { reportErrorThroughHoneyBadger } from 'src/shared/utils/errors'
32+
33+ export const getQuartzIdentityThunk = ( ) => async (
34+ dispatch : Dispatch < any > ,
35+ getState : GetState
36+ ) => {
3737 if ( ! isFlagEnabled ( 'quartzIdentity' ) ) {
3838 dispatch ( getQuartzMeThunk ( ) )
3939 return
@@ -50,10 +50,14 @@ export const getQuartzIdentityThunk = () => async dispatch => {
5050 const legacyMe = convertIdentityToMe ( quartzIdentity )
5151 dispatch ( setQuartzMe ( legacyMe , RemoteDataState . Done ) )
5252 dispatch ( setQuartzMeStatus ( RemoteDataState . Done ) )
53- } catch ( error ) {
53+ } catch ( err ) {
5454 dispatch ( setQuartzIdentityStatus ( RemoteDataState . Error ) )
5555 dispatch ( setQuartzMeStatus ( RemoteDataState . Error ) )
56- dispatch ( notify ( updateIdentityFailed ( ) ) )
56+
57+ reportErrorThroughHoneyBadger ( err , {
58+ name : 'Failed to fetch /quartz/identity' ,
59+ context : { state : getState ( ) } ,
60+ } )
5761 }
5862}
5963
@@ -75,10 +79,14 @@ export const getBillingProviderThunk = () => async (
7579 const legacyMe = convertIdentityToMe ( updatedState . identity . currentIdentity )
7680 dispatch ( setQuartzMe ( legacyMe , RemoteDataState . Done ) )
7781 dispatch ( setQuartzMeStatus ( RemoteDataState . Done ) )
78- } catch ( error ) {
82+ } catch ( err ) {
7983 dispatch ( setQuartzIdentityStatus ( RemoteDataState . Error ) )
8084 dispatch ( setQuartzMeStatus ( RemoteDataState . Error ) )
81- dispatch ( notify ( updateBillingFailed ( ) ) )
85+
86+ reportErrorThroughHoneyBadger ( err , {
87+ name : 'Failed to fetch /quartz/accounts/' ,
88+ context : { state : getState ( ) } ,
89+ } )
8290 }
8391}
8492
@@ -101,9 +109,13 @@ export const getCurrentOrgDetailsThunk = () => async (
101109 const legacyMe = convertIdentityToMe ( updatedState . identity . currentIdentity )
102110 dispatch ( setQuartzMe ( legacyMe , RemoteDataState . Done ) )
103111 dispatch ( setQuartzMeStatus ( RemoteDataState . Done ) )
104- } catch ( error ) {
112+ } catch ( err ) {
105113 dispatch ( setQuartzIdentityStatus ( RemoteDataState . Error ) )
106114 dispatch ( setQuartzMeStatus ( RemoteDataState . Error ) )
107- dispatch ( notify ( updateOrgFailed ( ) ) )
115+
116+ reportErrorThroughHoneyBadger ( err , {
117+ name : 'Failed to fetch /quartz/orgs/:orgId' ,
118+ context : { state : getState ( ) } ,
119+ } )
108120 }
109121}
0 commit comments