Skip to content

Improve error handling for 'package-registry login' command #6286

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

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Mar 15, 2023

Motivation:
When running login with --netrc and --netrc-file options and the custom netrc file doesn't exist, the command fails immediately with file not found error:

swift-package-registry --netrc --netrc-file ./netrc-test login
Error: Did not find netrc file at /Users/appleseed/netrc-test.

Which can be confusing.

Modifications:
Rearrange logic so that we initialize AuthorizationProvider first thing and display better error messages to user.

Error: credential store is invalid: did not find netrc file at /Users/appleseed/netrc-test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 15, 2023

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 15, 2023

cc @Palleas

@yim-lee yim-lee force-pushed the better-login-error branch from 6ecadd3 to dd096eb Compare March 16, 2023 00:09
@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci please test Windows platform

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci pleases test Windows platform

1 similar comment
@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci pleases test Windows platform

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci pleases smoke test

1 similar comment
@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci pleases smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci pleases test Windows platform

yim-lee added 4 commits March 15, 2023 18:14
Motivation:
When running `login` with `--netrc` and `--netrc-file` options and the custom netrc file doesn't exist, the command fails immediately with file not found error:

```
swift-package-registry --netrc --netrc-file ./netrc-test login
Error: Did not find netrc file at /Users/appleseed/netrc-test.
```

Which can be confusing.

Modifications:
Rearrange logic so that we initialize `AuthorizationProvider` first thing and display better error messages to user.

```
Error: credential store is invalid: did not find netrc file at /Users/appleseed/netrc-test
```
@yim-lee yim-lee force-pushed the better-login-error branch from 63e1592 to 5fce1a6 Compare March 16, 2023 01:14
@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Mar 16, 2023

@swift-ci please test Windows platform

@yim-lee yim-lee merged commit 9702161 into swiftlang:main Mar 16, 2023
@yim-lee yim-lee deleted the better-login-error branch March 16, 2023 05:57
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