Skip to content

Commit

Permalink
Error Handler가 정상 작동하지 않고 Internal Server Error를 반환하는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
odumag99 committed Jan 8, 2025
1 parent 52a232c commit a92a0e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snuvote/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


@app.exception_handler(RequestValidationError)
def validation_exception_handler(request: Request, exc: RequestValidationError):
async def validation_exception_handler(request: Request, exc: RequestValidationError):
for error in exc.errors():
if isinstance(error, dict) and error.get("type", None) == "missing":
raise MissingRequiredFieldError()
return request_validation_exception_handler(request, exc)
return await request_validation_exception_handler(request, exc)

0 comments on commit a92a0e6

Please sign in to comment.