Skip to content

Commit a8e4448

Browse files
authored
feat(js): Expose rejectOnError in public execute type declarations (#2628)
Adds the new `rejectOnError` value for the `live` option to the remaining `.execute` type declarations so that this mode can also be set by library consumers directly calling `.execute` (e.g. `@sentry/react-router` SDK).
1 parent 2ba3e57 commit a8e4448

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

js/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ declare module '@sentry/cli' {
217217

218218
newDeploy(release: string, options: SentryCliNewDeployOptions): Promise<string>;
219219

220-
execute(args: string[], live: boolean): Promise<string>;
220+
execute(args: string[], live: boolean | 'rejectOnError'): Promise<string>;
221221
}
222222

223223
export default class SentryCli {
@@ -237,6 +237,6 @@ declare module '@sentry/cli' {
237237

238238
public static getVersion(): string;
239239
public static getPath(): string;
240-
public execute(args: string[], live: boolean): Promise<string>;
240+
public execute(args: string[], live: boolean | 'rejectOnError'): Promise<string>;
241241
}
242242
}

js/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ class SentryCli {
5757
/**
5858
* See {helper.execute} docs.
5959
* @param {string[]} args Command line arguments passed to `sentry-cli`.
60-
* @param {boolean} live We inherit stdio to display `sentry-cli` output directly.
60+
* @param {boolean | 'rejectOnError'} live can be set to:
61+
* - `true` to inherit stdio to display `sentry-cli` output directly.
62+
* - `false` to not inherit stdio and return the output as a string.
63+
* - `'rejectOnError'` to inherit stdio and reject the promise if the command
64+
* exits with a non-zero exit code.
6165
* @returns {Promise.<string>} A promise that resolves to the standard output.
6266
*/
6367
execute(args, live) {

0 commit comments

Comments
 (0)