kloudlite / kl

Kloudlite CLI Client
GNU Affero General Public License v3.0
5 stars 1 forks source link

error message added #191

Closed nxtcoder36 closed 1 week ago

nxtcoder36 commented 1 week ago

Summary by Sourcery

Enhance error handling by adding descriptive messages to error returns across various functions, improving the clarity and context of error reporting.

Enhancements:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This pull request adds more detailed error messages to various functions across multiple files. The main change is the addition of descriptive error messages when wrapping errors with functions.NewE(). This improves error handling and debugging by providing more context about where and why errors occur.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Enhanced error handling with descriptive messages
  • Added specific error messages when wrapping errors with functions.NewE()
  • Updated error handling in API client requests
  • Improved error messages in file operations
  • Enhanced error reporting in command execution functions
domain/fileclient/context.go
domain/apiclient/request.go
pkg/functions/exec.go
domain/apiclient/main.go
domain/fileclient/kl-file.go
Updated error printing behavior
  • Modified PrintError function to consider verbose flag
pkg/functions/error.go

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).