Hey guys,
I need to catch some exceptions and return proper ProblemDetails response.
For example:
curl -X DELETE --header 'Accept: application/problem+json' 'https://demo.api-platform.com/books/6'
returns:
Status: 500
{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "An error occurred",
"detail": "Internal Server Error"
}
which based on my case I presume is because of the foreign key constraint for the relation to 'Reviews'
In the logs there is an PDO exception that I need to catch and return 409 Conflict for example (or somethign else)
How do I hook to the flow and return ApiProblemResponse?
Hey guys,
I need to catch some exceptions and return proper ProblemDetails response.
For example:
curl -X DELETE --header 'Accept: application/problem+json' 'https://demo.api-platform.com/books/6'returns:
which based on my case I presume is because of the foreign key constraint for the relation to 'Reviews'
In the logs there is an PDO exception that I need to catch and return
409 Conflictfor example (or somethign else)How do I hook to the flow and return ApiProblemResponse?