Fix not being able to close the app during login flow

This commit is contained in:
DevilXD committed 2022-03-21 13:22:22 +01:00
1 parent 98451d9342
commit 7beb10df8d
3 files changed
+39 -3

No files matched your search

+25
View File
@@ -1,4 +1,7 @@
class MinerException(Exception):
"""
Base exception class for this application.
"""
def __init__(self, *args: object):
if args:
super().__init__(*args)
@@ -6,7 +9,23 @@ class MinerException(Exception):
super().__init__("Unknown miner error")
class ExitRequest(MinerException):
"""
Raised when the application is requested to exit from outside of the main loop.
Intended for internal use only.
"""
def __init__(self, *args: object):
if args:
super().__init__(*args)
else:
super().__init__("Unknown error during request")
class RequestException(MinerException):
"""
Raised for cases where a web request doesn't return what we wanted it to.
"""
def __init__(self, *args: object):
if args:
super().__init__(*args)
@@ -15,6 +34,9 @@ class RequestException(MinerException):
class LoginException(RequestException):
"""
Raised when an exception occurs during login phase.
"""
def __init__(self, *args: object):
if args:
super().__init__(*args)
@@ -23,5 +45,8 @@ class LoginException(RequestException):
class CaptchaRequired(LoginException):
"""
The most dreaded thing about automated scripts.
"""
def __init__(self):
super().__init__("Captcha is required")