mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-08-22 02:08:44 +00:00
21 lines
477 B
Python
21 lines
477 B
Python
|
class HttpRequestError(Exception):
|
||
|
"""Http request failed"""
|
||
|
|
||
|
status: int = 0
|
||
|
reason: str = ""
|
||
|
message: str = ""
|
||
|
|
||
|
def __init__(
|
||
|
self,
|
||
|
status: int,
|
||
|
reason: str,
|
||
|
message: str | None = None,
|
||
|
*args: object,
|
||
|
) -> None:
|
||
|
if not message:
|
||
|
message = f"[{status}] {reason}"
|
||
|
self.status = status
|
||
|
self.reason = reason
|
||
|
self.message = message
|
||
|
super().__init__(message, *args)
|