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

Update Error Handling and Logging Mechanism #399

Closed
wants to merge 1 commit into from

Conversation

vinayakjaas
Copy link

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #366 .):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

The scope of this PR is to update the error handling and logging mechanisms in the following files:

  • reporter.go: Introduces centralized error logging and Adjusts log levels and refactors error handling functions.
  • main.go: Updates error handling to use the new logging and error handling mechanisms.

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

How to Demonstrate:

  • Modify the client.NewKpmClient() function in client package or introduce a similar simulated error to test error handling.
func NewKpmClient() (*KpmClient, error) {
    return nil, goerr.New("simulated client creation error")
}
  • Execute the application with the command:
go run main.go
  • Output
ERROR[0000] Operation failed: failed to initialize kpm client - simulated client creation error 
exit status 1

pullrequest

@vinayakjaas vinayakjaas marked this pull request as ready for review July 24, 2024 16:05
Copy link

github-actions bot commented Jul 24, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@vinayakjaas
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@vinayakjaas
Copy link
Author

recheck

Peefy added a commit to kcl-lang/cla.db that referenced this pull request Jul 27, 2024
@Peefy
Copy link
Contributor

Peefy commented Aug 1, 2024

cc @zong-zhe Cloud you help review it?

@Peefy
Copy link
Contributor

Peefy commented Aug 1, 2024

CI failed. cc @vinayakjaas

@Peefy
Copy link
Contributor

Peefy commented Aug 22, 2024

@vinayakjaas Are you still working on this PR?

@zong-zhe zong-zhe closed this Sep 13, 2024
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.

kpm needs Debug Mode to show and record more detailed logs
3 participants