From 0c63b8f5e5a24378bcd221cdd85f659b4e10a72d Mon Sep 17 00:00:00 2001
From: gotbadger
Date: Fri, 13 Feb 2026 16:39:12 +0000
Subject: [PATCH] CM-59577: handle 401 errors gracefully
---
cycode/cli/exceptions/custom_exceptions.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/cycode/cli/exceptions/custom_exceptions.py b/cycode/cli/exceptions/custom_exceptions.py
index 59c0f693..78781914 100644
--- a/cycode/cli/exceptions/custom_exceptions.py
+++ b/cycode/cli/exceptions/custom_exceptions.py
@@ -47,12 +47,9 @@ class ReportAsyncError(CycodeError):
pass
-class HttpUnauthorizedError(RequestError):
+class HttpUnauthorizedError(RequestHttpError):
def __init__(self, error_message: str, response: Response) -> None:
- self.status_code = 401
- self.error_message = error_message
- self.response = response
- super().__init__(self.error_message)
+ super().__init__(401, error_message, response)
def __str__(self) -> str:
return f'HTTP unauthorized error occurred during the request. Message: {self.error_message}'