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 errors if some of multiple ids do not exist #66

Open
msmolyakov opened this issue Sep 11, 2020 · 0 comments
Open

Handle errors if some of multiple ids do not exist #66

msmolyakov opened this issue Sep 11, 2020 · 0 comments

Comments

@msmolyakov
Copy link
Member

There are methods in the Node API that allow you to request information about several listed entities at once:

  • GET/POST /addresses/balance
  • GET/POST /addresses/data/{address}
  • GET assets/details
  • GET/POST transactions/merkleProof
  • GET/POST transactions/status

Check how WavesJ behaves if some of the requested ids are incorrect for some reason:

  • id is not a correct base58 string
  • entity with this id doesn't exist in blockchain

Example: /assets/details?id=CG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24a&id=DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p

Add handling of such cases. Some of the possible approaches:

  1. throw an exception if at least one id is incorrect
  2. for such methods, return an object with two fields: a list with info for correct ids and a list List<Error> errors with info for incorrect ids.
  3. just skip errors and return only info for correct ids.
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

1 participant