diff --git a/inline.py b/inline.py index caa2769..c6e4f64 100644 --- a/inline.py +++ b/inline.py @@ -153,23 +153,28 @@ class InlineBot: r = requests.post(self.config.getApiUrl(), headers = { "Content-Type" : "application/json", "User-Agent" : self.config.getUserAgent() }, data = json.JSONEncoder().encode(JSONRequest(self.config, command.getName(), senderid, text).__dict__)) if not r: + self.logger.warning('Request api fail') return None if len(r.text) < 1: + self.logger.warning('Request text api fail') return None resp = None try: resp = json.loads(r.text, object_hook = asResponse) except: + self.logger.warning('JSON deserialization failed') return None ## Invalid json if not resp.isAuthorized() or not resp.succeeded(): + self.logger.warning('Unathorized/Unsuccessfull') return None txt = r.headers[command.getHeaderField()] if len(txt) < 1: + self.logger.warning('Wrong response in header:',command.getHeaderField()) return None ## Wrong api? return txt