Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: return 400 instead of 500 for image fetch errors (#9157)

cthomasdd7e28fae6be
diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py
index bd2fda023..fa523f5ed 100644
--- a/letta/server/rest_api/app.py
+++ b/letta/server/rest_api/app.py
@@ -38,6 +38,7 @@ from letta.errors import (
HandleNotFoundError,
LettaAgentNotFoundError,
LettaExpiredError,
+ LettaImageFetchError,
LettaInvalidArgumentError,
LettaInvalidMCPSchemaError,
LettaMCPConnectionError,
@@ -477,6 +478,7 @@ def create_application() -> "FastAPI":
app.add_exception_handler(LettaToolNameConflictError, _error_handler_400)
app.add_exception_handler(AgentFileImportError, _error_handler_400)
app.add_exception_handler(EmbeddingConfigRequiredError, _error_handler_400)
+ app.add_exception_handler(LettaImageFetchError, _error_handler_400)
app.add_exception_handler(ValueError, _error_handler_400)
# 404 Not Found errors