Skip to content

Exit code ignored with SentryCli.execute([...], true) (live mode) #2062

@dotboris

Description

@dotboris

CLI Version

2.31.2

Operating System and Architecture

  • macOS (arm64)
  • macOS (x86_64)
  • Linux (i686)
  • Linux (x86_64)
  • Linux (armv7)
  • Linux (aarch64)
  • Windows (i686)
  • Windows (x86_64)

Operating System Version

Ubuntu 20.4 & MacOS 14.4.1

Link to reproduction repository

No response

CLI Command

No response

Exact Reproduction Steps

Run the following in a node REPL: node -i

> const SentryCli = require('@sentry/cli')
undefined
> await new SentryCli().execute(['does not exist'], true)
error: unrecognized subcommand 'does not exist'

Usage: sentry-cli [OPTIONS] <COMMAND>

For more information, try '--help'.
undefined

Note that under the hood, sentry-cli's exit code is 2 in this context.

Expected Results

I expect the execute([...], true) function to throw an Error that I can catch and react to. It does throw an error when the second argument is false but not when it's set to true.

Actual Results

No errors are thrown, the command ends as if everything was OK

Logs

There are no logs in this context

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions