Don't crash if registration returns HTTP 500
This commit is contained in:
@@ -300,7 +300,9 @@ class IntentAPI:
|
|||||||
try:
|
try:
|
||||||
self.client.register({"username": self.localpart})
|
self.client.register({"username": self.localpart})
|
||||||
except MatrixRequestError as e:
|
except MatrixRequestError as e:
|
||||||
if matrix_error_code(e) != "M_USER_IN_USE":
|
if matrix_error_code(e) == "M_UNKNOWN":
|
||||||
|
self.log.exception("Internal server error while registering!")
|
||||||
|
elif matrix_error_code(e) != "M_USER_IN_USE":
|
||||||
raise IntentError(f"Failed to register {self.mxid}", e)
|
raise IntentError(f"Failed to register {self.mxid}", e)
|
||||||
self.registered = True
|
self.registered = True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user