[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
This commit is contained in:
@@ -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)
|
||||
|
||||
#----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user