Skip to content

[Bug] CLI exits successfully with code 0 in the case of a fatal missing credentials failure #226

Open
@jonaldinger

Description

@jonaldinger

Current Behavior

When an error is thrown for missing credentials, the error message is rendered but the process exits with code 0 indicating success.

My use case is to push translations via CI as part of our deployment process. The credentials in our CI environment variables got wiped at some point, and we never realized the translation pushes stopped happening because the job still "succeeds" even though it actually failed.

Expected Behavior

When a fatal error occurs, the process should exit with a non-zero exit code so that automated tooling (such as CI) can respond to the failure. My use case is specific to missing credentials in the push action, but there may be other scenarios that warrant this same outcome.

Steps to Reproduce

Call a CLI command such as push, without providing any credentials:

txjs-cli push src/

Observe the error message logged, but the command succeeding:

image

Possible Solution

Return a non-zero exit code for fatal errors.

Possible Implementation

https://github.com/transifex/transifex-javascript/blob/master/packages/cli/src/commands/push.js#L156

process.exit(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions