Skip to content

Commit

Permalink
APIv2(ledger_entry): return "invalidParams" when fields missing (XRPL…
Browse files Browse the repository at this point in the history
…F#4552)

Improve error handling for ledger_entry by returning an "invalidParams"
error when one or more request fields are specified incorrectly, or one
or more required fields are missing.

For example, if none of of the following fields is provided, then the
API should return an invalidParams error:
* index, account_root, directory, offer, ripple_state, check, escrow,
  payment_channel, deposit_preauth, ticket

Prior to this commit, the API returned an "unknownOption" error instead.
Since the error was actually due to invalid parameters, rather than
unknown options, this error was misleading.

Since this is an API breaking change, the "invalidParams" error is only
returned for requests using api_version: 2 and above. To maintain
backward compatibility, the "unknownOption" error is still returned for
api_version: 1.

Related: XRPLF#4573

Fix XRPLF#4303
  • Loading branch information
arihantkothari committed Jul 4, 2023
1 parent 8298953 commit 90b04cb
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 90b04cb

Please sign in to comment.