#66261·symfony

Feature request: Add ContentTooLargeHttpException

Author: lugie15Created Sep 24, 2026Updated Sep 24, 2026

Description

Symfony provides dedicated HttpException subclasses for various HTTP status codes, but there does not appear to be a dedicated exception for HTTP status 413.

Currently, this requires using the generic HttpException, for example:

throw new HttpException(
    Response::HTTP_REQUEST_ENTITY_TOO_LARGE,
    'The request content is too large.'
);

Would it make sense to add a dedicated exception such as:

ContentTooLargeHttpException

This would improve readability and consistency with the existing specialized HttpException classes.

Naming / RFC 9110

RFC 9110 renamed the reason phrase for HTTP status 413 to "Content Too Large".

Previously, the status was commonly referred to as "Payload Too Large" or "Request Entity Too Large".

Symfony currently still exposes the status code through:

Response::HTTP_REQUEST_ENTITY_TOO_LARGE

For a newly introduced exception class, using the current RFC terminology could therefore make sense:

ContentTooLargeHttpException

rather than:

PayloadTooLargeHttpException

The exception could simply extend HttpException and use status code 413, similar to the other specialized HTTP exceptions.

Reference: RFC 9110, section 15.5.14 — 413 Content Too Large.

Example

No response