fix: handled the missing keyring error gracefully with a user-friendly message #2900
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This pull request improves error handling in the
build_sessionfunction of thegoose-clicrate. Specifically, it replaces anunwrapcall with a more robust error-handling mechanism to provide user-friendly error messages and guidance.Error handling improvements:
build_sessionfunction incrates/goose-cli/src/session/builder.rsto replace theunwrapcall with amatchstatement. This change ensures that errors during the creation of a provider are caught and handled gracefully. If an error occurs, a detailed error message is displayed, including troubleshooting steps and a link to relevant documentation, before the process exits with a non-zero status.Details:
The error message displayed when no keyring is found is different from what the goose doc mentioned. It currently looked like this (Display

thread 'main' panicked....is kinda off to users I think, since this message is intended for developers and exposes internal file paths and implementation details that are confusing or irrelevant to end users.)I made the system handle the error gracefully and display a user-friendly message with reference to the troubleshooting session to the goose doc.