fix: catch error if server is not reachable
This commit is contained in:
parent
b24ea7530f
commit
a0c463d466
@ -26,7 +26,12 @@ del(data)
|
||||
|
||||
|
||||
def check_login(login: str) -> bool:
|
||||
try:
|
||||
response = get(url=":".join([SERVER, str(PORT)]) + '/scan2kasse/login', json={'login': login})
|
||||
except Exception as e:
|
||||
LOGGER.exception(e)
|
||||
return False
|
||||
else:
|
||||
if response.status_code == 200:
|
||||
return True
|
||||
return False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user