Fix various problems in minecraft.authentication and its tests:
- Return value of _make_request() is treated as a requests.Request, when it is in fact a requests.Response. - Some tests in test_authentication use assertRaises() incorrectly, resulting in testing code that never gets run. - Other miscellaneous errors exposed by the above changes. Additionally: - YggdrasilError instances now have fields with specific error information, and _raise_from_response() populates them. (This will be useful for later changes.)
This commit is contained in:
1 parent
73672401ef
commit
66a0603acf
4 files changed
+115
-79
No files matched your search
@@ -7,6 +7,23 @@ class YggdrasilError(Exception):
|
||||
"""
|
||||
Base `Exception` for the Yggdrasil authentication service.
|
||||
"""
|
||||
def __init__(
|
||||
self,
|
||||
message=None,
|
||||
status_code=None,
|
||||
yggdrasil_error=None,
|
||||
yggdrasil_message=None,
|
||||
yggdrasil_cause=None,
|
||||
*args
|
||||
):
|
||||
if message is not None:
|
||||
args = (message,) + args
|
||||
super(YggdrasilError, self).__init__(*args)
|
||||
|
||||
self.status_code = status_code
|
||||
self.yggdrasil_error = yggdrasil_error
|
||||
self.yggdrasil_message = yggdrasil_message
|
||||
self.yggdrasil_cause = yggdrasil_cause
|
||||
|
||||
|
||||
class VersionMismatch(Exception):
|
||||
|
||||
Reference in new issue
Block a user