Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Improver Exception handling Octokit (GitHub). Exceptions will show more info than the current "Validation Error" #836

Merged
merged 2 commits into from
Jul 2, 2019

Conversation

StephanTuinder
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

feature (kid of)

⤵️ What is the current behavior?

When Octokit throws an error, the only thing logged is "Validation Error" which is not much help.

🆕 What is the new behavior (if this is a feature change)?

The Body of the http response (if there) is parsed to see if the real error can be determined.
If errors can be found in the body, the first will be in the message of the Exception thrown.
The original Exception is passed to the thrown Exception als innerException.
The thrown exception will be a NuKeeper exception.

💥 Does this PR introduce a breaking change?

no

🐛 Recommendations for testing

As an example you could try to run nukeeper on a repository that you only have read access to.

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build

@StephanTuinder StephanTuinder changed the title Improver Exception handling Octokit. Exceptions will show more info than the current "Validation Error" Improver Exception handling Octokit (GitHub). Exceptions will show more info than the current "Validation Error" Jun 28, 2019
Copy link
Member

@shep1987 shep1987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please put the try catch into one place this adds a lot of duplication

@StephanTuinder
Copy link
Contributor Author

I know it leads to duplication, but I don't see how I could create a global exeption handler for this class alone. I will do some research.

@StephanTuinder
Copy link
Contributor Author

StephanTuinder commented Jun 30, 2019

Added global exception handler for class

@shep1987 shep1987 merged commit f003fa6 into NuKeeperDotNet:master Jul 2, 2019
@StephanTuinder StephanTuinder deleted the Verbose-Octokit branch July 6, 2019 22:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants