Skip to content

Make LineTooLong exception more detailed about actual data size. #2857

@popravich

Description

@popravich

Long story short

Currently seeing such exceptions in logs doesn't help much in understanding how big the actual data was:

Traceback (most recent call last):
  ...
  File "aiohttp/_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
  File "aiohttp/_http_parser.pyx", line 422, in aiohttp._http_parser.cb_on_header_value
aiohttp.http_exceptions.LineTooLong: 400, message='Got more than 8190 bytes when reading Header value is too long.'

Although HttpParser has the max_field_size argument allowing to control this limit it is better
to know how big received data is to increase this limit to some reasonable value.

So, I'd like to modify LineTooLong exception extending it with one more argument actual_size.

@aio-libs/aiohttp-committers, thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions