Fix/raise error if status fail
We found a new exception case to raise an API exception.
When the API returns a 200 OK
status code but in the body, in the status, we find a FAIL
status.
This case applies to the invoice/sendByEmail
endpoint. See the following Postman example:
The status code is 200 OK
but the body:
{
"status": "FAIL",
"message": "INVOICE_NOT_SENT_BY_EMAIL"
}
Show an error message in the message
item, no errorCode
was returned and a FAIL
status.
Also, we fix the FakeResponse json()
method, break until now but untested. See the commit message for more information.