Skip to content

Commit 295e9b3

Browse files
committed
adding todo
1 parent 538734a commit 295e9b3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

osbot_fast_api/api/Fast_API.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def __init__(self, **kwargs):
3838
self.name = self.__class__.__name__
3939
self.http_events.fast_api_name = self.name
4040

41+
# todo: improve the error handling of validation errors (namley from Type_Safe_Primitive)
42+
# see code example in https://claude.ai/chat/f443e322-fa43-487f-9dd9-2d4cfb261b1e
4143
def add_global_exception_handlers(self):
4244
import traceback
4345
from fastapi import Request, HTTPException

osbot_fast_api/api/routes/Fast_API__Routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def wrapper(**kwargs):
106106
result = function(**converted_kwargs) # Call original function
107107
except HTTPException:
108108
raise # Re-raise HTTPException unchanged
109-
# except RequestValidationError:
110-
# raise # also re-raise RequestValidationError
109+
except RequestValidationError:
110+
raise # also re-raise RequestValidationError
111111
except Exception as e:
112112
raise HTTPException(status_code=400, detail=f"{type(e).__name__}: {e}") # Convert exceptions to HTTP 400
113113

0 commit comments

Comments
 (0)