Added handling for unauth error (#5115)

This commit is contained in:
Eric Forte
2025-09-16 08:55:10 -04:00
committed by GitHub
parent b2b9d677c7
commit 99ebad576b
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -1050,6 +1050,15 @@ def update_navigator_gists(
raise raise_client_error(
"Gist not found: verify the gist_id exists and the token has access to it", exc=exc
) from exc
if exc.response.status_code == requests.status_codes.codes.unauthorized:
text = json.loads(exc.response.text).get(
"message", "verify the token is valid and has the necessary permissions"
)
error_message = f"Unauthorized: {text}"
raise raise_client_error(
error_message,
exc=exc,
) from exc
raise
response_data = response.json()
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "1.4.2"
version = "1.4.3"
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 Securitys Detection Engine."
readme = "README.md"
requires-python = ">=3.12"