-
Notifications
You must be signed in to change notification settings - Fork 1
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
API request failures seem to be able to return empty errors #37
Comments
We believe there was an issues with a recent deployment to the API. Hopefully this has sine been resolved. |
Hi @tomasbasham Sorry, perhaps the reference in the report confused the issue. This issue still remains as it's an issue with the Go code within this library. This client library still has code paths that return what is in effect |
Ah right. I believe I understand now. Sorry for the confusion. It looks like either the API itself is not returning and error, or as you suggest the response is not in the right format and not being correctly unmarshaled. I've assumed the specific problem being reported is this:
That there is no message after the colon. Is that right? |
Yes, it meant we had no further information when the Update started to fail to provide to your teams when we hit the issue. We've since implemented to be able to turn on the "Debug" flag against the client and log bodies, but we can't really leave that running generally so it doesn't help with intermittent issues. The other thing we wanted to report in the above was these return statements within the above code: testResp, err := client.GetUptimeTest(ctx, id).Execute()
if err != nil {
return "", fmt.Errorf("failed to get Uptime Test: %w", err)
}
if testResp.Data.Name == "" {
return "", fmt.Errorf("failed to get Uptime Test: %w", errors.New("response returned without error but has no name"))
}
if testResp.Data.ID == "" {
return "", fmt.Errorf("failed to get Uptime Test: %w", errors.New("response returned without error but has no ID"))
} We've seen these hit before tail end of last year which seemed odd. For them to be hit there was no error returned from getting the UptimeTest but the response had no Name/ID. |
Describe the bug
""
).Additional context
We are running a small go tool to perform OAuth token updates on StatusCake uptime tests.
To Reproduce
We've since found the
Debug
option within the library but it's too verbose to run all the time. We've built in flags so we can try to get more detail next time if it becomes reproducible/consistent.Most recently it was
Updating
an uptime test. We've seen it a fair few times on theGetUptimeTest
too, please note the edge case catches in the code below.You could use the StatusCake API changes that resulted in support request 22508200886017? They triggered it persistently. My hunch is it's a response that doesn't correspond to the expected response format, but that's a complete guess based on similar issues I've seen elsewhere in client libs.
Expected behavior
Library errors should allow clients to provide context failure to StatusCake. An
""
error return is probably never be acceptable.Detail
I've smashed the relevant bits out of a few places into the below representative code:
Application logs look like the following, note the lack of error detail, I'd expect an error there that described the issue.
The text was updated successfully, but these errors were encountered: