(self, reason: Failure = connectionDone)
| 713 | ) |
| 714 | |
| 715 | def connectionLost(self, reason: Failure = connectionDone) -> None: |
| 716 | if self._finished.called: |
| 717 | return |
| 718 | |
| 719 | if reason.check(ResponseDone): |
| 720 | self._finish_response() |
| 721 | return |
| 722 | |
| 723 | if reason.check(PotentialDataLoss): |
| 724 | self._finish_response(flags=["partial"]) |
| 725 | return |
| 726 | |
| 727 | if reason.check(ResponseFailed) and any( |
| 728 | r.check(_DataLoss) |
| 729 | for r in reason.value.reasons # type: ignore[union-attr] |
| 730 | ): |
| 731 | if not self._fail_on_dataloss: |
| 732 | self._finish_response(flags=["dataloss"]) |
| 733 | return |
| 734 | |
| 735 | exc = ResponseDataLossError() |
| 736 | exc.__cause__ = reason.value |
| 737 | reason = Failure(exc) |
| 738 | |
| 739 | self._finished.errback(reason) |
nothing calls this directly
no test coverage detected