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

Handle null ledger entries and return a better error for missing accounts #110

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

paulbellamy
Copy link
Contributor

This is the js client version of stellar/stellar-cli#771

If the soroban-rpc server finds no matching entries for a getLedgerEntries, it will return entries: null. The client should handle this.

Also, if we try to do a getAccount and don't find it, we can return a more helpful error to the user.

@paulbellamy paulbellamy requested a review from Shaptic July 14, 2023 08:50
Copy link

@chadoh chadoh left a comment

Choose a reason for hiding this comment

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

Thanks! Definitely an improvement!

@@ -34,7 +34,7 @@ export namespace SorobanRpc {
/* Response for jsonrpc method `getLedgerEntries`
*/
export interface GetLedgerEntriesResponse {
entries: LedgerEntryResult[];
entries: LedgerEntryResult[] | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

why couldn't it just be empty instead of null 😭

@Shaptic Shaptic merged commit c86beb5 into main Jul 17, 2023
3 checks passed
@Shaptic Shaptic deleted the handle-null-ledger-entries branch July 17, 2023 18:13
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.

3 participants