File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed
Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 33 "trackUsage" : {
44 "invalidEvent" : " Usage tracking event {{ eventName }} is not a valid event type." ,
55 "sendingEventAuthenticated" : " Sending usage event to authenticated endpoint" ,
6+ "retryingEventUnauthenticated" : " Failed to send the usage event as authenticated. Trying again as unauthenticated." ,
67 "sendingEventUnauthenticated" : " Sending usage event to unauthenticated endpoint"
78 },
89 "archive" : {
Original file line number Diff line number Diff line change @@ -44,21 +44,16 @@ export async function trackUsage(
4444
4545 if ( accountConfig && accountConfig . authType === 'personalaccesskey' ) {
4646 logger . debug ( i18n ( `${ i18nKey } .sendingEventAuthenticated` ) ) ;
47- await http . post ( accountId , {
48- url : `${ path } /authenticated` ,
49- data : usageEvent ,
50- resolveWithFullResponse : true ,
51- } ) ;
52- } else {
53- const env = getEnv ( accountId ) ;
54- const axiosConfig = getAxiosConfig ( {
55- env,
56- url : path ,
57- data : usageEvent ,
58- resolveWithFullResponse : true ,
59- } ) ;
60- logger . debug ( i18n ( `${ i18nKey } .sendingEventUnauthenticated` ) ) ;
61- axios ( { ...axiosConfig , method : 'post' } ) ;
47+ try {
48+ const result : void = await http . post ( accountId , {
49+ url : `${ path } /authenticated` ,
50+ data : usageEvent ,
51+ resolveWithFullResponse : true ,
52+ } ) ;
53+ return result ;
54+ } catch ( e ) {
55+ logger . debug ( i18n ( `${ i18nKey } .retryingEventUnauthenticated` ) ) ;
56+ }
6257 }
6358
6459 const env = getEnv ( accountId ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @hubspot/local-dev-lib" ,
3- "version" : " 1.13.0 " ,
3+ "version" : " 1.13.1 " ,
44 "description" : " Provides library functionality for HubSpot local development tooling, including the HubSpot CLI" ,
55 "main" : " lib/index.js" ,
66 "repository" : {
You can’t perform that action at this time.
0 commit comments