mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:39:02 +08:00
Interpret timeouts as general connection errors
It's a similar problem for us. We should really have used the HttpRequestManager for these things. Fixes Sentry issue CURA-295.
This commit is contained in:
parent
515c7459d3
commit
e60e44b919
@ -1,12 +1,12 @@
|
|||||||
# Copyright (c) 2020 Ultimaker B.V.
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
from hashlib import sha512
|
from hashlib import sha512
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from typing import Optional, Any, Dict, Tuple
|
from typing import Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
@ -115,7 +115,7 @@ class AuthorizationHelpers:
|
|||||||
token_request = requests.get(check_token_url, headers = {
|
token_request = requests.get(check_token_url, headers = {
|
||||||
"Authorization": "Bearer {}".format(access_token)
|
"Authorization": "Bearer {}".format(access_token)
|
||||||
})
|
})
|
||||||
except requests.exceptions.ConnectionError:
|
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
|
||||||
# Connection was suddenly dropped. Nothing we can do about that.
|
# Connection was suddenly dropped. Nothing we can do about that.
|
||||||
Logger.logException("w", "Something failed while attempting to parse the JWT token")
|
Logger.logException("w", "Something failed while attempting to parse the JWT token")
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user