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

Fix bug in RestartAPIError #953

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Fix bug in RestartAPIError #953

merged 1 commit into from
Apr 23, 2024

Conversation

saunderst
Copy link
Contributor

What are you trying to accomplish with this PR?
Fix a minor bug in the RestartAPIError class, introduced in #284. All the calls to RestartAPIError.new were changed to pass an error message instead of an HTTP response, but the initialize method itself wasn't adjusted accordingly. The result looks like this:

/root/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/krane-3.5.1/lib/krane/restart_task.rb:17:in `initialize': undefined method `code' for "Timed out connecting to server":String (NoMethodError)
            "API returned non-200 response code (#{response.code})\n" \

How is this accomplished?
Simply print the supplied error message instead of trying to parse an HTTP response.

What could go wrong?
Still printing the wrong thing would be the most severe consequence.

@saunderst
Copy link
Contributor Author

saunderst commented Apr 12, 2024

Question for reviewers: is it necessary to create a release for this minor change, or can we just merge it and fold it into the next release?

@timothysmith0609
Copy link
Contributor

Question for reviewers: is it necessary to create a release for this minor change, or can we just merge it and fold it into the next release?

It's your choice: we don't do many releases of Krane these days so I don't mind cutting a new patch version for this. If you do so, please update the CHANGELOG accordingly

@saunderst saunderst merged commit 70514e4 into main Apr 23, 2024
65 checks passed
@saunderst saunderst deleted the fix-bug-in-RestartAPIError branch April 23, 2024 19:00
@saunderst saunderst mentioned this pull request May 7, 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.

2 participants