Fix except message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2023-01-24 17:21:33 +01:00
parent d7556f84b4
commit 625c2c2af0

View File

@ -54,7 +54,7 @@ class FlareRequests(requests.Session):
content = response.json()
if "solution" in content:
if "solution" in content and content["solution"]:
solution = content["solution"]
raw = solution["response"].encode()
encoding = charset_normalizer.detect(raw)
@ -70,14 +70,14 @@ class FlareRequests(requests.Session):
return resolved
raise requests.RequestException(response)
raise requests.RequestException(content["message"], response=response)
except requests.RequestException:
session = requests.post(
FLARE_ENDPOINT,
json={"cmd": "sessions.destroy", "session": FLARE_SESSION},
)
raise requests.RequestException(solution)
raise requests.RequestException(content["message"], response=response)
session = FlareRequests()