Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle origin connection issues without throwing #46

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

f1ames
Copy link
Contributor

@f1ames f1ames commented Dec 15, 2023

This PR fixes issue where CLI would error when origin cannot be reached.

This is mostly related to policy config synchronization and:

  1. It makes sense to catch such errors for validate and config commands where we can fallback to local config.
    • The command will run fine. When --debug flag is provided it will additionally display warning with error message (if there is one). This is because it needs to be debug-able and users should be able to see the reason why local config was used as fallback.
  2. For auth related commands the behavior is the same as before since without connecting to origin, those can't basically run. The only addition is that isAuthenticated check will not throw when origin cannot be reached, just return false - this makes the correct error to be shown while those commands fail.

Changes

  • None.

Fixes

  • As above.

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

@f1ames f1ames force-pushed the f1ames/fix/fail-no-origin branch from b437ae0 to d833539 Compare December 15, 2023 10:28
@f1ames f1ames marked this pull request as ready for review December 15, 2023 11:02
@f1ames f1ames merged commit baecf35 into master Dec 20, 2023
3 checks passed
@f1ames f1ames deleted the f1ames/fix/fail-no-origin branch December 20, 2023 09:14
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.

2 participants