peatio icon indicating copy to clipboard operation
peatio copied to clipboard

API- when there are missing params in a request, the error needs to be generic and accurate

Open TasyaBykova opened this issue 8 years ago • 2 comments

Steps to reproduce:

  1. Send a post request for example to 'https://platform.qa.etorox.io/api/v2/orders' (relevant to all calls)
  2. Do not insert price or any other mandatory param

Actual result:

  1. The code inside does not match the status code
  2. 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

TasyaBykova avatar May 07 '18 15:05 TasyaBykova

We are not going to do like this. We are going to fix this error and don't expose internal errors.

yivo avatar May 08 '18 08:05 yivo

Fixes at #1066.

yivo avatar May 09 '18 22:05 yivo