-
Notifications
You must be signed in to change notification settings - Fork 243
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
Handle unexpected type changes in PagerDuty REST API error responses #382
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should be backported to |
The PagerDuty REST API documentation[1] indicates that the `errors` field of an error response is an array of error strings. However, as shown in #339 the API sometimes violates that specification and instead returns the `errors` field as a string. There is a PagerDuty customer support ticket open[2] to to address this issue, but there is currently no ETA on the resolution. As such we are going to create this workaround to properly parse the invalid responses and return the proper error type to callers. Closes #339 [1] https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTYz-errors [2] https://tickets.pagerduty.com/hc/requests/341221
stmcallister
approved these changes
Nov 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense while the API shows the inconsistent behavior with returning errors. Thanks for adding this! 🎉
theckman
added a commit
that referenced
this pull request
Nov 14, 2021
The bug this fixes was introduced as part of v1.4.0, so we need to backport it into the v1.4.x release line. Because the master branch has diverged towards v1.5.0, we need to manually backport this to the release-1.4.x branch. Original commit message (0933613): The PagerDuty REST API documentation[1] indicates that the errors field of an error response is an array of error strings. However, as shown in #339 the API sometimes violates that specification and instead returns the errors field as a string. There is a PagerDuty customer support ticket open[2] to to address this issue, but there is currently no ETA on the resolution. As such we are going to create this workaround to properly parse the invalid responses and return the proper error type to callers. Closes #339 [1] https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTYz-errors [2] https://tickets.pagerduty.com/hc/requests/341221
theckman
added a commit
that referenced
this pull request
Nov 14, 2021
The bug this fixes was introduced as part of v1.4.0, so we need to backport it into the v1.4.x release line. Because the master branch has diverged towards v1.5.0, we need to manually backport this to the release-1.4.x branch. Original commit message (0933613): The PagerDuty REST API documentation[1] indicates that the errors field of an error response is an array of error strings. However, as shown in #339 the API sometimes violates that specification and instead returns the errors field as a string. There is a PagerDuty customer support ticket open[2] to to address this issue, but there is currently no ETA on the resolution. As such we are going to create this workaround to properly parse the invalid responses and return the proper error type to callers. Closes #339 Backports #382 [1] https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTYz-errors [2] https://tickets.pagerduty.com/hc/requests/341221
theckman
added a commit
that referenced
this pull request
Nov 14, 2021
Backport PR #382 to release-1.4.x branch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PagerDuty REST API documentation[1] indicates that the
errors
field of anerror response is an array of error strings. However, as shown in #339 the API
sometimes violates that specification and instead returns the
errors
field asa string.
There is a PagerDuty customer support ticket open[2] to to address this issue, but
there is currently no ETA on the resolution. As such we are going to create this
workaround to properly parse the invalid responses and return the proper error
type to callers.
Closes #339
[1] https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTYz-errors
[2] https://tickets.pagerduty.com/hc/requests/341221