File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,6 +164,13 @@ return [
164164];
165165` ` `
166166
167+ > [!WARNING] The `exception_to_status` configuration is **not merged** with the defaults: as soon as
168+ > you declare your own mapping, it replaces the built-in one entirely. If you omit the default
169+ > handlers shown above, exceptions that were previously mapped to `400` (such as the
170+ > `Symfony\Component\Serializer\Exception\ExceptionInterface` thrown when denormalizing a relation
171+ > to a non-existing item, or an invalid backed enum value) will fall through to the `500` fallback.
172+ > Always keep the default lines and append your custom mappings to them.
173+
167174Any type of `Exception` can be thrown, API Platform will convert it to a Symfony's `HttpException`
168175(note that it means the exception will be flattened and lose all of its custom properties). The
169176framework also takes care of serializing the error description according to the request format. For
You can’t perform that action at this time.
0 commit comments