Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Change the API response to return an array of errors #3152

Closed
SargeKhan opened this issue Mar 22, 2019 · 5 comments
Closed

Change the API response to return an array of errors #3152

SargeKhan opened this issue Mar 22, 2019 · 5 comments
Assignees

Comments

@SargeKhan
Copy link
Contributor

SargeKhan commented Mar 22, 2019

Expected behavior

The API response should return all the errors encountered when processing a request. Therefore, the structure of the API response should be:

{
   "code": 404,
   "error": [{
      message: "<ERROR_MESSAGE>"
   },
   {
      ...
   }]
}

Actual behavior

The structure of API response in case of an error is not very extensible. It contains only one property with the name message which is of type string. In cases where there are multiple errors, it is impossible to return all the errors in this format. The current structure of the API response in case of an error is as follow:

{
   "code": 404,
   "message": "<ERROR_MESSAGE>"
}

Which version(s) does this affect? (Environment, OS, etc...)

1.7

@pablitovicente
Copy link
Contributor

We should also check processUnconfirmedTransaction() in transaction pool as it's only returning one error

@pablitovicente
Copy link
Contributor

We should fix any tests tagged with [feature/improve_transactions_processing_efficiency] on this PR or if scope goes to much up then we should split in different issue blocked by this one

@mitsuaki-u
Copy link
Contributor

We should also check processUnconfirmedTransaction() in transaction pool

Yes that's fixed in the branch I'm working on. I am in the process of updating tests.

@pablitovicente
Copy link
Contributor

@mitsujutsu be aware that PR #3268 fixes integration and some unit tests so you should check that branch (is about to be merged tough)

@mitsuaki-u
Copy link
Contributor

@pablitovicente Ok I am currently working on functional tests so that should not be an issue.

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

No branches or pull requests

4 participants