added exception handling for no route
This commit is contained in:
parent
c893229098
commit
9b860a0ca6
1 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,7 @@ import logging
|
||||||
|
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
from os.path import abspath, join
|
from os.path import abspath, join
|
||||||
from requests.exceptions import InvalidSchema, SSLError
|
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
|
||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve
|
||||||
|
|
||||||
logger = logging.getLogger('varken')
|
logger = logging.getLogger('varken')
|
||||||
|
@ -99,6 +99,9 @@ def connection_handler(session, request, verify):
|
||||||
except SSLError as e:
|
except SSLError as e:
|
||||||
logger.error('Either your host is unreachable or you have an SSL issue. : %s', e)
|
logger.error('Either your host is unreachable or you have an SSL issue. : %s', e)
|
||||||
|
|
||||||
|
except ConnectionError as e:
|
||||||
|
logger.error('Cannot resolve the url/ip/port. Check connectivity. Error: %s', e)
|
||||||
|
|
||||||
return return_json
|
return return_json
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue