Skip to content

Commit c4d2703

Browse files
committed
Add FilterValidationException and OptimisticLockException to the default config
1 parent a0dd799 commit c4d2703

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ errors:
7373
api_platform:
7474
# ...
7575
exception_to_status:
76-
# The 2 following handlers are registered by default, keep those lines to prevent unexpected side effects
76+
# The 4 following handlers are registered by default, keep those lines to prevent unexpected side effects
7777
Symfony\Component\Serializer\Exception\ExceptionInterface: 400 # Use a raw status code (recommended)
7878
ApiPlatform\Core\Exception\InvalidArgumentException: 'HTTP_BAD_REQUEST' # Or a `Symfony\Component\HttpFoundation\Response`'s constant
79+
ApiPlatform\Core\Exception\FilterValidationException: 400
80+
Doctrine\ORM\OptimisticLockException: 409
7981

82+
# Custom mapping
8083
App\Exception\ProductNotFoundException: 404 # Here is the handler for our custom exception
8184
```
8285

0 commit comments

Comments
 (0)