Skip to content

Commit 1d40ea4

Browse files
authored
Merge pull request #6128 from Shopify/story-copy-throw-error-monorail
To ensure we get failure metrics we need to throw the error instead of exiting with code 1
2 parents d1418e9 + bf9d380 commit 1d40ea4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/store/src/lib/base-command.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {FlagOptions} from './types.js'
22
import {checkForUndefinedFieldError} from '../services/store/utils/graphql-errors.js'
33
import Command from '@shopify/cli-kit/node/base-command'
4-
import {renderError} from '@shopify/cli-kit/node/ui'
4+
import {AbortError} from '@shopify/cli-kit/node/error'
55

66
export abstract class BaseBDCommand extends Command {
77
abstract runCommand(): Promise<void>
@@ -17,11 +17,8 @@ export abstract class BaseBDCommand extends Command {
1717
if (checkForUndefinedFieldError(error)) {
1818
errorMessage = `This command is in Early Accesss and is not yet available for the requested store(s).`
1919
}
20-
renderError({
21-
headline: `Operation failed`,
22-
body: errorMessage,
23-
})
24-
process.exit(1)
20+
21+
throw new AbortError(errorMessage)
2522
} else {
2623
throw error
2724
}

0 commit comments

Comments
 (0)