Просмотр исходного кода

fix: improve error handling in dashboard context and comment out unused variable in HTTP access service

Manuel 9 месяцев назад
Родитель
Сommit
03eafea60e
2 измененных файлов с 3 добавлено и 5 удалено
  1. 2 4
      routes/main_routes.py
  2. 1 1
      services/squid/http_access_service.py

+ 2 - 4
routes/main_routes.py

@@ -69,11 +69,9 @@ def _get_dashboard_context() -> tuple[dict[str, Any] | None, tuple[Any, int] | N
 
         try:
             connections = parse_raw_data(raw_data)
-        except Exception as parse_err:
+        except Exception:
             logger.exception("Error parsing Squid connections")
-            return None, _build_error_page(
-                "Error processing Squid data", 500, str(parse_err)
-            )
+            return None, _build_error_page("Error processing Squid data", 500)
 
         if not connections:
             logger.warning("No active connections detected in Squid output")

+ 1 - 1
services/squid/http_access_service.py

@@ -232,7 +232,7 @@ def remove_http_deny_blocklist(acl_name: str, config_manager) -> tuple[bool, str
     def _strip_deny(lines: list[str]) -> list[str]:
         """Return lines without the deny rule and its preceding comment."""
         result: list[str] = []
-        skip_next = False
+        #skip_next = False
         i = 0
         while i < len(lines):
             stripped = lines[i].strip()