odoo/odoo#201083

Created by fw-bot
Merged at 1827ec4cf6c436a6dfc76bf3c6e0625b33c4b53c

Statuses:

label
odoo-dev:saas-17.4-16.0-fix-iap-jsonrpc-error-handling-lba-421571-fw
head
5443e2183af41e3344394761bc0eb9c9195412b1
merged
8 months ago by iAP, Louis Baudoux (lba)
odoo/odoo
16.0 #199286
17.0 #200948
saas-17.4 #201083
18.0 #201089
saas-18.1 #201284
saas-18.2 #201301
saas-18.3
saas-18.4
19.0
master #201324

[FW][FIX] iap: fix error handling of `iap_jsonrpc`

This commit fixes the following issues:
- Only re-raise InsufficientCreditError from IAP. UserError, AccessError and ReadTimeout shouldn't be re-raised, they should considered as an internal error of the IAP server.
- Instead of raising a requests.exceptions.ConnectionError in case of an unknown error from IAP (which didn't make much sense), it will now raise a IAPServerError
- The logging level has been changed from exception to warning. There is indeed no useful information in the logged traceback as the interesting part is in the traceback on the IAP server logs.

Forward-Port-Of: #200948
Forward-Port-Of: #199286