Skip to content

Fix/raise error if status fail

Administrator requested to merge fix/raise-error-if-status-FAIL into master

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:

image

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. 😅

Merge request reports