| 21 | |
| 22 | |
| 23 | class WebSocketException(Exception): |
| 24 | def __init__(self, code: int, reason: str | None = None) -> None: |
| 25 | self.code = code |
| 26 | self.reason = reason or class="st">"" |
| 27 | |
| 28 | def __str__(self) -> str: |
| 29 | return fclass="st">"{self.code}: {self.reason}" |
| 30 | |
| 31 | def __repr__(self) -> str: |
| 32 | class_name = self.__class__.__name__ |
| 33 | return fclass="st">"{class_name}(code={self.code!r}, reason={self.reason!r})" |
| 34 | |
| 35 | |
| 36 | class StarletteDeprecationWarning(UserWarning): |
no outgoing calls