You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
FedoraRecord.get() returns an empty string if the response is not "200 OK":
methodget(this: FedoraRecord): string {. base .} =let response = this.client.request(this.uri, httpMethod =HttpGet)
if response.status =="200 OK":
response.body
else:
""
Because of this, we are assuming that other things that use FedoraRequest.get() expect an empty string to equate to a 500, 401, or a 403. While this might be perfectly fine for some uses, it sure is not for all and we aren't doing anything to log potential problems.
Expected behavior
Instead of returning an empty string, we should:
Minimally, log the fail.
Sleep and retry the request.
Doing the latter, should have effects on the FedoraRequest type and not solely this method.
Screenshots
methodget(this: FedoraRecord): string {. base .} =let response = this.client.request(this.uri, httpMethod =HttpGet)
if response.status =="200 OK":
response.body
else:
""
Additional context
It should be noted that all "200 OK" related methods on FedoraRequest should be reviewed, but we should do those in separate issues as the approach may be slightly different.
The text was updated successfully, but these errors were encountered:
Describe the bug
FedoraRecord.get() returns an empty string if the response is not "200 OK":
Because of this, we are assuming that other things that use FedoraRequest.get() expect an empty string to equate to a 500, 401, or a 403. While this might be perfectly fine for some uses, it sure is not for all and we aren't doing anything to log potential problems.
Expected behavior
Instead of returning an empty string, we should:
Doing the latter, should have effects on the FedoraRequest type and not solely this method.
Screenshots
Additional context
It should be noted that all "200 OK" related methods on FedoraRequest should be reviewed, but we should do those in separate issues as the approach may be slightly different.
The text was updated successfully, but these errors were encountered: