Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def matrix_join_room(matrix_client, matrix_config):
# type: (Any, Dict[str, Any]) -> Any
try:
room = matrix_client.join_room(matrix_config["room_id"])
return room
except MatrixRequestError as exception:
if exception.code == 403:
raise Bridge_FatalMatrixException("Room ID/Alias in the wrong format")
else:
raise Bridge_FatalMatrixException("Couldn't find room.")
def matrix_login(matrix_client, matrix_config):
# type: (Any, Dict[str, Any]) -> None
try:
matrix_client.login_with_password(matrix_config["username"],
matrix_config["password"])
except MatrixRequestError as exception:
if exception.code == 403:
raise Bridge_FatalMatrixException("Bad username or password.")
else:
raise Bridge_FatalMatrixException("Check if your server details are correct.")
except MissingSchema as exception:
raise Bridge_FatalMatrixException("Bad URL format.")
def matrix_login(matrix_client, matrix_config):
# type: (Any, Dict[str, Any]) -> None
try:
matrix_client.login_with_password(matrix_config["username"],
matrix_config["password"])
except MatrixRequestError as exception:
if exception.code == 403:
raise Bridge_FatalMatrixException("Bad username or password.")
else:
raise Bridge_FatalMatrixException("Check if your server details are correct.")
except MissingSchema as exception:
raise Bridge_FatalMatrixException("Bad URL format.")
def matrix_login(matrix_client, matrix_config):
# type: (Any, Dict[str, Any]) -> None
try:
matrix_client.login_with_password(matrix_config["username"],
matrix_config["password"])
except MatrixRequestError as exception:
if exception.code == 403:
raise Bridge_FatalMatrixException("Bad username or password.")
else:
raise Bridge_FatalMatrixException("Check if your server details are correct.")
except MissingSchema as exception:
raise Bridge_FatalMatrixException("Bad URL format.")