Add subcription feature 3
This commit is contained in:
@@ -320,18 +320,20 @@ class BaseFastAPIService:
|
||||
@self.app.exception_handler(Exception)
|
||||
async def general_exception_handler(request: Request, exc: Exception):
|
||||
"""Handle general exceptions"""
|
||||
self.logger.error(
|
||||
print(f"DEBUG_PRINT: Base service caught unhandled exception: {str(exc)} on path {request.url.path}")
|
||||
self.logger.critical(
|
||||
"Unhandled exception",
|
||||
error=str(exc),
|
||||
path=request.url.path,
|
||||
method=request.method
|
||||
method=request.method,
|
||||
exc_info=True
|
||||
)
|
||||
|
||||
return JSONResponse(
|
||||
status_code=500,
|
||||
content={
|
||||
"error": "Internal Server Error",
|
||||
"detail": "An unexpected error occurred",
|
||||
"detail": f"An unexpected error occurred: {str(exc)}",
|
||||
"type": "internal_error"
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user