Skip to content

Commit ca0439c

Browse files
authored
Merge pull request #704 from dunglas/pr_2337
Add FilterValidationException and OptimisticLockException to the default config
2 parents 4be8b10 + c4d2703 commit ca0439c

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)