mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-16 15:08:12 +08: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)
|