-
Notifications
You must be signed in to change notification settings - Fork 156
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
Propagate errors from JSON response #171
Conversation
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.
LGTM!
Hmm integrations test fail with these changes. Not sure why yet:
|
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.
Integration tests fail with these changes. Not ready to merge.
@knyar you have more context on this than I do, are you good to investigate and fix this by yourself? |
Apologies for not checking the integration tests. I can't reproduce these errors after rebasing my change, so I suspect they were caused by the fact that I had my patch applied on top of a pretty old commit. After making some minor changes to |
Hey @knyar. Can you verify you are able to successfully run You'll need to set DATADOG_API_KEY and DATADOG_APP_KEY for them to run. Running locally on my laptop, using
|
Yep, the tests pass when I run them against a fresh Datadog account: https://knyar.net/paste/raw/6c42eb96.txt I suspect the failures might be caused by specific data present in the account you are using for the tests. I will try to add more data to my account manually and see if I can make tests fail in a similar way, but if you could grab JSON output from Datadog API (just for TestDowntimeGet, TestMonitorGet, TestMonitorGetWithoutNoDataTimeframe, and TestScreenboardShareAndRevoke) that would help a lot. |
Interesting! @knyar I'm a little busy at the moment, but I've shot you an invite to the DD account we use and you can have a gander yourself. Ping me here if you did not receive it. |
Thanks! The failures were caused by some API responses being arrays that could not be unmarshalled into a struct. I've adjusted the new error checking code, and tests are passing now. |
Fantastic, that does sound like the root cause. Thanks for the quick turnaround! |
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.
LGTM 👍
Thanks again @knyar, your changes are included in https://github.com/zorkian/go-datadog-api/releases/tag/v2.14.0 |
This fixes #170.