how can I manage custom errors coming from the server?

Viewed 23

I use Jhipster with react as frontend with loopback as server side, I should show custom error ( ex. tax code already present in the archive). this is format error

{
    "error": {
        "statusCode": 422,
        "name": "UnprocessableEntityError",
        "message": "The request body is invalid. See error object `details` property for more info.",
        "code": "VALIDATION_FAILED",
        "details": [
            {
                "path": "partitaIva",
                "message": "Partita Iva già presente",
                "code": "CUSTOM_ERROR",
                "info": {}
            }
        ]
    }
}

There could be more errors too, like for a form. I want to know how to display the error returned by server.

0 Answers
Related