Skip to content

Commit 7a87486

Browse files
Added handling for unauth error
1 parent 4476ac5 commit 7a87486

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

detection_rules/devtools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,10 @@ def raw_permalink(raw_link: str) -> str:
10501050
raise raise_client_error(
10511051
"Gist not found: verify the gist_id exists and the token has access to it", exc=exc
10521052
) from exc
1053+
if exc.response.status_code == requests.status_codes.codes.unauthorized:
1054+
raise raise_client_error(
1055+
"Unauthorized: verify the token is valid and has the necessary permissions", exc=exc
1056+
) from exc
10531057
raise
10541058

10551059
response_data = response.json()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "detection_rules"
3-
version = "1.4.1"
3+
version = "1.4.2"
44
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)