Skip to content

Need to handle failure cases in API calls #5

Open

Description

@mjyeaney

In the example below, we aren't handling the failure scenario for remote API calls (which can fail). Need to provide explicit handling of these cases - should likely extract a unit-of-work pattern here to help with testing.

response = await httpclient.AsyncHTTPClient().fetch(
method="POST",
body=test_data.read(),
request=apiUrl,
headers={
"Prediction-Key": self.predictionKey,
"Content-Type": "application/octet-stream"
},
raise_error=False
)
results = json.loads(response.body.decode())

Activity

  1. added
    bugSomething isn't working
    Code-ReviewIssue is a result of code review
    on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code-ReviewIssue is a result of code reviewbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions