Skip to content

Error handling and exit codes #554

Closed

Description

@meringu

Describe the bug

The ldcli command isn't returning the expected error code (non zero) when a command fails.

To reproduce

Firstly, run up a new ldcli docker container:

docker run --rm -it --entrypoint sh launchdarkly/ldcli

Then, add an invalid header token to invoke an error:

/ # export LD_ACCESS_TOKEN=fake
/ # /ldcli flags list --project test
Invalid account ID header (code: unauthorized)
/ # echo $?
0

Expected behavior

The log is correct as there was an error, but it returned with exit code 0. I expect it to return with any code but 0.

Logs

See the steps to reproduce

CLI version

/ # /ldcli --version
ldcli version 1.14.0

OS/platform

MacOS, but I reproduced it in the docker container.

Activity

  1. sheenacarswell commented on Jun 13, 2025

    @sheenacarswell

    Thank you @meringu for this report. We have added this to our backlog and hope to address it soon.

    (Internal note: this is issue REL-8111)

  2. sloloris commented on Jul 30, 2025

    @sloloris
    Member

    Hi @meringu ! Sorry for the delay on this. A fix has been pushed out in v1.16.2; if you are managing via Homebrew, you can just run brew upgrade ldcli and it should upgrade automatically.

    Thank you for your patience! I will leave this open for a few more days in case you have any further issues or comments and then close it out.

  3. meringu commented on Jul 30, 2025

    @meringu
    Author

    Thanks @sloloris!

    I'm currently traveling, so I won't be able to test. Feel free to close. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions