sealcode / sealious

An extensible, declarative node framework
25 stars 2 forks source link

Trello#better rest requests error output #250

Closed adwydman closed 8 years ago

adwydman commented 8 years ago

Console output:

13:13:53.208 - error:   PATCH /api/v1/pet/rvv1gcncns
            from: 127.0.0.1, mime: multipart/form-data
            result: failed - There are problems with some of the provided values: 
 * species - This species of animal is not accepted
 * age - Value `sssss` is not a int number format.

Error: There are problems with some of the provided values: 
 * species - This species of animal is not accepted
 * age - Value `sssss` is not a int number format.

    at new SealiousErrors.Error (/home/adrian/Documents/Sealious/sealious/lib/response/error.js:6:12)

Http client output:

{
  "data": {
    "species": "This species of animal is not accepted",
    "age": "Value `sssss` is not a int number format."
  },
  "is_error": true,
  "type": "validation",
  "status_message": "There are problems with some of the provided values: \n * species - This species of animal is not accepted\n * age - Value `sssss` is not a int number format.\n"
}