Skip to content
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

Improve error handling in API interactions #34

Open
bencromwell opened this issue Jul 2, 2024 · 0 comments
Open

Improve error handling in API interactions #34

bencromwell opened this issue Jul 2, 2024 · 0 comments

Comments

@bencromwell
Copy link
Collaborator

bencromwell commented Jul 2, 2024

Example:

$postOrganizationManagedResponse = katapult()->postOrganizationManaged($managedOrganization);
assert($postOrganizationManagedResponse instanceof OrganizationsOrganizationManagedPostResponse201, new Exception());
$newManagedOrganization = $postOrganizationManagedResponse->getOrganization();

Here we just ensure we got a 201 back of the appropriate type defined by the OpenAPI spec.

We should handle these better to account for, for instance, 503s, which will come through as PSR ResponseInterface instances.

It'd be nice to provide the option for retries in situations such as that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant