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:
Gabriel Luiz Freitas Almeida 2025-09-04 18:32:38 -03:00
parent 9494e99808
commit 69834ac4ac

View file

@ -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)