From 7f2e15f874950f53d96994ef72c4a19d069f4f55 Mon Sep 17 00:00:00 2001 From: Hynek Urban Date: Fri, 12 Jul 2024 20:51:28 +0200 Subject: [PATCH] Propagate specific login errors. --- rocketchat_async/methods.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rocketchat_async/methods.py b/rocketchat_async/methods.py index eeea03f..6ca339a 100644 --- a/rocketchat_async/methods.py +++ b/rocketchat_async/methods.py @@ -77,6 +77,8 @@ def _get_request_msg(msg_id, username, password): @staticmethod def _parse(response): + if "error" in response: + raise RuntimeError(response['error']['reason']) return response['result']['id'] @classmethod