Attempted to read or stream content, but the content has already been streamed.
| 307 | |
| 308 | |
| 309 | class StreamConsumed(StreamError): |
| 310 | """ |
| 311 | Attempted to read or stream content, but the content has already |
| 312 | been streamed. |
| 313 | """ |
| 314 | |
| 315 | def __init__(self) -> None: |
| 316 | message = ( |
| 317 | "Attempted to read or stream some content, but the content has " |
| 318 | "already been streamed. For requests, this could be due to passing " |
| 319 | "a generator as request content, and then receiving a redirect " |
| 320 | "response or a secondary request as part of an authentication flow." |
| 321 | "For responses, this could be due to attempting to stream the response " |
| 322 | "content more than once." |
| 323 | ) |
| 324 | super().__init__(message) |
| 325 | |
| 326 | |
| 327 | class StreamClosed(StreamError): |