Skip to content

Comments

fix: return errors in user elevate command to prevent silent failures#661

Open
samruddhi-Rahegaonkar wants to merge 2 commits intogoharbor:mainfrom
samruddhi-Rahegaonkar:fix-error-handling-655
Open

fix: return errors in user elevate command to prevent silent failures#661
samruddhi-Rahegaonkar wants to merge 2 commits intogoharbor:mainfrom
samruddhi-Rahegaonkar:fix-error-handling-655

Conversation

@samruddhi-Rahegaonkar
Copy link

What this PR does

This PR fixes improper error handling in the user elevate command.

Previously, errors were logged using log.Errorf without returning, causing the CLI to continue execution with invalid state and exit successfully even after critical failures.

The command now uses Cobra’s RunE pattern and returns errors immediately, ensuring correct exit behavior and preventing silent failures.

Related issue

Fixes #655

@samruddhi-Rahegaonkar
Copy link
Author

@bupd please review this.
This fixes missing error returns in the user elevate command.

Signed-off-by: Samruddhi Rahegaonkar <rsamruddhi21@gmail.com>
Signed-off-by: Samruddhi Rahegaonkar <rsamruddhi21@gmail.com>
@samruddhi-Rahegaonkar
Copy link
Author

@bupd @qcserestipy I’ve updated the PR to focus on a centralized logging and error-handling approach rather than a command-specific fix.

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.

CLI continues execution after log.Errorf() instead of returning error

1 participant