mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
first commit
This commit is contained in:
20
mihomo/errors.py
Normal file
20
mihomo/errors.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user