feat: Show a friendly message when not connected into any cluster#199
Open
matheusandre1 wants to merge 1 commit intokgrep-org:mainfrom
Open
feat: Show a friendly message when not connected into any cluster#199matheusandre1 wants to merge 1 commit intokgrep-org:mainfrom
matheusandre1 wants to merge 1 commit intokgrep-org:mainfrom
Conversation
Collaborator
|
That's probably enough. Thank you @matheusandre1. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #97 by implementing user-friendly error messages when users are not connected to a Kubernetes cluster. The changes introduce an error wrapping mechanism that translates technical Kubernetes API errors into human-readable messages.
Changes:
- Added a new
WrapKubernetesErrorfunction to detect and wrap common Kubernetes errors (unauthorized, forbidden, missing configuration) - Applied error wrapping to all Kubernetes API calls in
resource_searcher.gothat create configs, list resources, or discover APIs - Error messages now guide users to check authentication, permissions, or kubeconfig setup
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/resource/errors.go | New file implementing WrapKubernetesError function to provide user-friendly error messages for Kubernetes API errors |
| internal/resource/resource_searcher.go | Updated all error returns from Kubernetes API calls to wrap errors through WrapKubernetesError |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b27242a to
5708e1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes: #97
Hello @hbelmiro , Is this acceptable, or do you need to use slog?