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

Improve error messages structure #46

Closed
AyeOne opened this issue Jun 9, 2023 · 2 comments
Closed

Improve error messages structure #46

AyeOne opened this issue Jun 9, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@AyeOne
Copy link
Contributor

AyeOne commented Jun 9, 2023

Feature Description

Improve error messages structure, as it makes it easier to solve a problem for end-user.
For example:

❌ Error checking target state. Unexpected error: The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.

Can be

❌ Error checking target state. 

⚠️ The SSO session associated with this profile has expired. 

To refresh the SSO session, please run the following command with the corresponding profile:

aws sso login --profile <profile_name>

Proposed Solution

Separate error message from suggested fix, when it's possible

Related Issues/PRs

not yet : )

@AyeOne AyeOne added the enhancement New feature or request label Jun 9, 2023
@BohdanPetryshyn
Copy link
Collaborator

Thank you for submitting an issue!

Basti has a mechanism for matching errors and enhancing their error messages. The "Unexpected error: " part of the error message you received means that the SSO error was not matched and the original error message (from AWS SDK) was shown.

To cover the error with enhanced handling, you have to:

  1. Identify the AWS error and wrap it with a Basti error in all AWS Clients. (example)
  2. Create a detailProvider for the new error. Detail Providers generate error details (messaged) for the known errors: (example)

@BohdanPetryshyn BohdanPetryshyn added the good first issue Good for newcomers label Jul 16, 2023
@BohdanPetryshyn
Copy link
Collaborator

I'm sorry, but I'm closing this issue to clean up a bit. The existing error message provides enough information for the user to solve the problem. It literally tells the solution 🙂

To refresh this SSO session run aws sso login with the corresponding profile.

@BohdanPetryshyn BohdanPetryshyn closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants