-
Notifications
You must be signed in to change notification settings - Fork 183
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
Restore BC in all()
methods with empty Redmine response
#337
Restore BC in all()
methods with empty Redmine response
#337
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v2.x #337 +/- ##
============================================
+ Coverage 95.98% 96.37% +0.39%
- Complexity 395 434 +39
============================================
Files 27 27
Lines 1220 1298 +78
============================================
+ Hits 1171 1251 +80
+ Misses 49 47 -2 ☔ View full report in Codecov by Sentry. |
I've investigated the issue about handling empty response bodies from Redmine and I've found a BC break in PHP-Redmine-API starting with v2.2.0 in After rewriting to But for the (deprecated) |
all()
methods with empty Redmine response
This PR handles a possible bug of Redmine. If Redmine is called with an unknown query_id parameter, Redmine responses with an 404 status code and an empty response body.
I'm not sure if in this case we should return an empty array or throw an more meaningful exception. Because this case throws a JsonException at the moment, it should not be a breaking change to throw another exception.
Any thoughts?
Refs #335.