Skip to content

Return the HTTP error response body when a request fails#28

Merged
danielrbrowne merged 3 commits intomasterfrom
feature/http-error-response-body
Apr 1, 2021
Merged

Return the HTTP error response body when a request fails#28
danielrbrowne merged 3 commits intomasterfrom
feature/http-error-response-body

Conversation

@danielrbrowne
Copy link
Copy Markdown
Owner

This PR:

  • Adds a errorResponseBody associated value to the failedResponse case of APIotaClientError.
  • Adds ErrorResponse associated type on APIotaCodableEndpoint.
  • Renames Response associated type to SuccessResponse on APIotaCodableEndpoint.
  • Returns an error if sending the 'URLRequest' fails completely
    • This handles the case when the OS cannot even send the URLRequest to the server at all due to a OS error.

- Adds a 'errorResponseBody' associated value to the 'failedResponse' case of 'APIotaClientError'.
- Adds 'ErrorResponse' associated type on 'APIotaCodableEndpoint'.
- Renames 'Response' associated type to 'SuccessResponse' on 'APIotaCodableEndpoint'.
- This handles the case when the OS cannot even send the URLRequest to the server at all due to a OS error.
@danielrbrowne danielrbrowne added the feature New feature being introduced label Apr 1, 2021
@danielrbrowne danielrbrowne merged commit 5cb5b8c into master Apr 1, 2021
@danielrbrowne danielrbrowne deleted the feature/http-error-response-body branch April 1, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature being introduced

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant