Skip to content

Conversation

@jayzambrano
Copy link

This refactor of the handle_response function ensures that the function can handle cases where the "Error" field is absent in the API response. Previously, the function assumed "Error" would always be present, potentially causing issues when it was missing.

With this update:

The function now prioritizes responses with "UserBalance" or "FileUrl" fields.
It handles the "FileUrl" case only when the value is a string, treating these as successful responses.

Copy link
Owner

@ekaputra07 ekaputra07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @jayzambrano 👍

@ekaputra07 ekaputra07 merged commit 39a614d into ekaputra07:main Oct 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants