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

HTTP status code check is missing when parsing Avnu RPC endpoint response #476

Open
ptisserand opened this issue Feb 26, 2025 · 2 comments
Assignees

Comments

@ptisserand
Copy link
Collaborator

HTTP status code from Avnu RPC endpoint response is not checked: there is only a check if JSON is well formatted.

try {
final jsonResponse = json.decode(response.body);
// Check if response is empty or malformed
if (jsonResponse == null) {
throw FormatException('Empty response received from server');
}

But even in case of HTTP error, response contains a valid JSON body so it will failed in the caller of callRpcEndpoint when trying to deserialize the returned value.

An explicit error should be raised when HTTP status code is an error.

@olayemiabdul
Copy link

May I handle this issue?

@rukafe0x
Copy link
Contributor

Hi @ptisserand, could you please assign me to this issue?

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

No branches or pull requests

3 participants