We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d51960f commit 7a25d8bCopy full SHA for 7a25d8b
src/login.py
@@ -1,4 +1,5 @@
1
from requests import Session
2
+from requests.exceptions import JSONDecodeError
3
from bs4 import BeautifulSoup, Tag
4
import re
5
from typing import Any
@@ -46,7 +47,15 @@ def login_with_drexel_connect(session: Session) -> Session:
46
47
assert (
48
response.status_code == 200
49
), "Failed to request MFA code page from Drexel Connect"
- json_response = response.json()
50
+
51
+ try:
52
+ json_response = response.json()
53
+ except JSONDecodeError:
54
+ raise Exception(
55
+ "Failed to decode JSON response from Drexel Connect. Response: {}".format(
56
+ response.text
57
+ )
58
59
60
data = {
61
json_response["csrfN"]: json_response["csrfV"],
0 commit comments