mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-29 02:46:25 +02:00
simplify indexing pipeline DB error handling
This commit is contained in:
parent
66d7d3da8a
commit
5be58b78ad
3 changed files with 1 additions and 51 deletions
|
|
@ -12,8 +12,7 @@ from litellm.exceptions import (
|
|||
Timeout,
|
||||
UnprocessableEntityError,
|
||||
)
|
||||
from sqlalchemy.exc import IntegrityError, InvalidRequestError, OperationalError
|
||||
from sqlalchemy.orm.exc import DetachedInstanceError
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
# Tuples for use directly in except clauses.
|
||||
RETRYABLE_LLM_ERRORS = (
|
||||
|
|
@ -34,18 +33,6 @@ PERMANENT_LLM_ERRORS = (
|
|||
APIResponseValidationError,
|
||||
)
|
||||
|
||||
TRANSIENT_DB_ERRORS = (
|
||||
OperationalError,
|
||||
IntegrityError,
|
||||
)
|
||||
|
||||
# Session is broken after these — re-raise instead of attempting further DB calls.
|
||||
FATAL_DB_ERRORS = (
|
||||
InvalidRequestError,
|
||||
DetachedInstanceError,
|
||||
)
|
||||
|
||||
|
||||
# (LiteLLMEmbeddings, CohereEmbeddings, GeminiEmbeddings all normalize to RuntimeError).
|
||||
EMBEDDING_ERRORS = (
|
||||
RuntimeError, # local device failure or API backend normalization
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue