@@ -88,8 +88,11 @@ export default abstract class ThemeCommand extends Command {
8888 throw new AbortError ( `Path does not exist: ${ flags . path } ` )
8989 }
9090
91- await this . command ( flags , session , false , args )
92- await this . logAnalyticsData ( session )
91+ try {
92+ await this . command ( flags , session , false , args )
93+ } finally {
94+ await this . logAnalyticsData ( session )
95+ }
9396 return
9497 }
9598
@@ -267,8 +270,11 @@ export default abstract class ThemeCommand extends Command {
267270 const commandName = this . constructor . name . toLowerCase ( )
268271 recordEvent ( `theme-command:${ commandName } :multi-env:authenticated` )
269272
270- await this . command ( flags , session , true , { } , { stdout, stderr} )
271- await this . logAnalyticsData ( session )
273+ try {
274+ await this . command ( flags , session , true , { } , { stdout, stderr} )
275+ } finally {
276+ await this . logAnalyticsData ( session )
277+ }
272278 } )
273279
274280 // eslint-disable-next-line no-catch-all/no-catch-all
@@ -371,7 +377,6 @@ export default abstract class ThemeCommand extends Command {
371377 if ( ! session ) return
372378
373379 const data = compileData ( )
374-
375380 await addPublicMetadata ( ( ) => ( {
376381 store_fqdn_hash : hashString ( session . storeFqdn ) ,
377382
0 commit comments