mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-24 07:20:27 +02:00
* bump fastapi and starlette * bumping llama index and nltk and associated deps * bump to fix python-multipart * bump aiohttp * update package lock for examples/widget * bump black * sentencesplitter has changed namespaces * fix reorder import check, fix missing passlib * update package-lock.json * black formatter updated * reformatted again * change to black compatible reorder * change to black compatible reorder-python-imports fork * fix pytest dependency * black format again * we don't need cdk.txt. update packages to be consistent across all packages --------- Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app> Co-authored-by: Richard Kuo <rkuo@rkuo.com>
25 lines
619 B
Python
25 lines
619 B
Python
"""
|
|
Standardized error handling utilities.
|
|
"""
|
|
|
|
from onyx.configs.app_configs import CONTINUE_ON_CONNECTOR_FAILURE
|
|
from onyx.utils.logger import setup_logger
|
|
|
|
logger = setup_logger()
|
|
|
|
|
|
def handle_connector_error(e: Exception, context: str) -> None:
|
|
"""
|
|
Standard error handling for connectors.
|
|
|
|
Args:
|
|
e: The exception that was raised
|
|
context: A description of where the error occurred
|
|
|
|
Raises:
|
|
The original exception if CONTINUE_ON_CONNECTOR_FAILURE is False
|
|
"""
|
|
logger.error(f"Error in {context}: {e}", exc_info=e)
|
|
if not CONTINUE_ON_CONNECTOR_FAILURE:
|
|
raise
|