Skip to content

fix(cortex-cli): exit with non-zero code on JSON parse failure in import command#45

Merged
echobt merged 1 commit intomasterfrom
fix/bounty-issue-1536
Jan 26, 2026
Merged

fix(cortex-cli): exit with non-zero code on JSON parse failure in import command#45
echobt merged 1 commit intomasterfrom
fix/bounty-issue-1536

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 26, 2026

Summary

This PR fixes an issue where the cortex import command prints an error message when encountering malformed JSON but exits with code 0 instead of a non-zero exit code.

Changes

  • Modified import_cmd.rs to explicitly print the error message and exit with code 1 when JSON parsing fails
  • This follows the same pattern used in other commands like run and login

Testing

When importing a malformed JSON file:

  • Before: Error message printed but exit code was 0
  • After: Error message printed and exit code is 1

Related

Fixes PlatformNetwork/bounty-challenge#1536

…ort command

Fixes bounty issue #1536

The import command was printing an error message when encountering
malformed JSON but exiting with code 0. This fix ensures the process
exits with code 1 when JSON parsing fails, allowing scripts and CI
pipelines to properly detect the error condition.
@echobt echobt force-pushed the fix/bounty-issue-1536 branch from b7eefb9 to 84284c6 Compare January 26, 2026 16:33
@echobt echobt merged commit df08b35 into master Jan 26, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] cortex import exits 0 on JSON parse failure

2 participants