Refactor error logging in upload_user_file function
This commit replaces the print statement for error traceback with a structured logging approach using the logger. This change enhances error visibility and aligns with best practices for robust and well-documented async code.
This commit is contained in:
parent
9494e99808
commit
69834ac4ac
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ async def upload_user_file(
|
|||
)
|
||||
import traceback
|
||||
|
||||
print(f"[ERROR] Traceback: {traceback.format_exc()}")
|
||||
logger.error("Full traceback", traceback=traceback.format_exc())
|
||||
return JSONResponse({"error": str(e)}, status_code=500)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue