bugfix
This commit is contained in:
15
helpers.py
15
helpers.py
@@ -35,16 +35,8 @@ import requests
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import openai
|
import openai
|
||||||
# NEU: Fehlerklassen werden direkt von openai importiert
|
# NEU: Korrigierte Imports für openai v1.x
|
||||||
from openai import (
|
from openai import APIError, RateLimitError, APIConnectionError, BadRequestError, AuthenticationError, Timeout
|
||||||
AuthenticationError,
|
|
||||||
OpenAIError,
|
|
||||||
RateLimitError,
|
|
||||||
APIError,
|
|
||||||
Timeout,
|
|
||||||
BadRequestError, # <-- KORRIGIERT (war InvalidRequestError)
|
|
||||||
APIConnectionError, # ServiceUnavailableError ist oft APIConnectionError
|
|
||||||
)
|
|
||||||
from config import (Config, BRANCH_MAPPING_FILE, URL_CHECK_MARKER, USER_AGENTS, LOG_DIR)
|
from config import (Config, BRANCH_MAPPING_FILE, URL_CHECK_MARKER, USER_AGENTS, LOG_DIR)
|
||||||
|
|
||||||
# Optionale Bibliotheken
|
# Optionale Bibliotheken
|
||||||
@@ -140,7 +132,8 @@ def retry_on_failure(func):
|
|||||||
decorator_logger.exception("Details:")
|
decorator_logger.exception("Details:")
|
||||||
raise e
|
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_msg = str(e)
|
||||||
error_type = type(e).__name__
|
error_type = type(e).__name__
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user