mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-09-12 11:52:33 +00:00
20 lines
477 B
Python
20 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)
|