From 99d0937261976c6d0cdf474364ba8ac78628fb08 Mon Sep 17 00:00:00 2001 From: Floke Date: Wed, 2 Jul 2025 20:26:54 +0000 Subject: [PATCH] bugfix --- helpers.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/helpers.py b/helpers.py index 05a56f3c..20a83ae0 100644 --- a/helpers.py +++ b/helpers.py @@ -35,16 +35,8 @@ import requests from bs4 import BeautifulSoup import pandas as pd import openai -# NEU: Fehlerklassen werden direkt von openai importiert -from openai import ( - AuthenticationError, - OpenAIError, - RateLimitError, - APIError, - Timeout, - BadRequestError, # <-- KORRIGIERT (war InvalidRequestError) - APIConnectionError, # ServiceUnavailableError ist oft APIConnectionError -) +# NEU: Korrigierte Imports für openai v1.x +from openai import APIError, RateLimitError, APIConnectionError, BadRequestError, AuthenticationError, Timeout from config import (Config, BRANCH_MAPPING_FILE, URL_CHECK_MARKER, USER_AGENTS, LOG_DIR) # Optionale Bibliotheken @@ -140,7 +132,8 @@ def retry_on_failure(func): decorator_logger.exception("Details:") raise e - except (requests.exceptions.RequestException, gspread.exceptions.APIError, OpenAIError, wikipedia.exceptions.WikipediaException) as e: + + except (requests.exceptions.RequestException, gspread.exceptions.APIError, APIError, wikipedia.exceptions.WikipediaException) as e: error_msg = str(e) error_type = type(e).__name__