Skip to content

Commit 7c975b0

Browse files
Update to include response text
1 parent 7a87486 commit 7c975b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

detection_rules/devtools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,13 @@ def raw_permalink(raw_link: str) -> str:
10511051
"Gist not found: verify the gist_id exists and the token has access to it", exc=exc
10521052
) from exc
10531053
if exc.response.status_code == requests.status_codes.codes.unauthorized:
1054+
text = json.loads(exc.response.text).get(
1055+
"message", "verify the token is valid and has the necessary permissions"
1056+
)
1057+
error_message = f"Unauthorized: {text}"
10541058
raise raise_client_error(
1055-
"Unauthorized: verify the token is valid and has the necessary permissions", exc=exc
1059+
error_message,
1060+
exc=exc,
10561061
) from exc
10571062
raise
10581063

0 commit comments

Comments
 (0)