peatio
peatio copied to clipboard
API- when there are missing params in a request, the error needs to be generic and accurate
Steps to reproduce:
- Send a post request for example to 'https://platform.qa.etorox.io/api/v2/orders' (relevant to all calls)
- Do not insert price or any other mandatory param
Actual result:
- The code inside does not match the status code
- Some of the errors are not clear such as: '"message": "Failed to create order. Reason: undefined method `*' for nil:NilClass"' (not inserting price)
Expected result: All errors should be in the following format: 'Failed to perform
{action}
. Reason:
{reason for failure}
Example: 'Failed to perform order. Reason: price is missing
We are not going to do like this. We are going to fix this error and don't expose internal errors.
Fixes at #1066.