From 696269bbc7781dfe320c62708cfafa8e71e69de0 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 20 Dec 2018 09:34:33 +0000 Subject: [PATCH] [FIX] iap: handle HTTPErrror and Timeout when contacting iap server When the iap sever is called, it is possible that the request timeout or that the webserver returns an error code (if the Odoo server is down for example) and we should warn the user instead of throwing an exception in a traceback closes odoo/odoo#29667 --- addons/iap/models/iap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/iap/models/iap.py b/addons/iap/models/iap.py index 5a94c6cf66d..13431caca7b 100644 --- a/addons/iap/models/iap.py +++ b/addons/iap/models/iap.py @@ -66,7 +66,7 @@ def jsonrpc(url, method='call', params=None): e.data = response['error']['data'] raise e return response.get('result') - except (ValueError, requests.exceptions.ConnectionError, requests.exceptions.MissingSchema) as e: + except (ValueError, requests.exceptions.ConnectionError, requests.exceptions.MissingSchema, requests.exceptions.Timeout, requests.exceptions.HTTPError) as e: raise exceptions.AccessError('The url that this service requested returned an error. Please contact the author the app. The url it tried to contact was ' + url) #----------------------------------------------------------