Skip to content

Need to handle failure cases in API calls #5

@mjyeaney

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())

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