Print traceback on server error

This commit is contained in:
Andrei Betlen 2023-10-10 15:56:04 -04:00
parent 43dfe1e2ab
commit d6a130a052

View file

@ -1,5 +1,6 @@
import sys
import json
import traceback
import multiprocessing
import time
from re import compile, Match, Pattern
@ -243,6 +244,7 @@ class RouteErrorHandler(APIRoute):
) -> Tuple[int, ErrorResponse]:
"""Wraps error message in OpenAI style error response"""
print(f"Exception: {str(error)}", file=sys.stderr)
traceback.print_exc(file=sys.stderr)
if body is not None and isinstance(
body,
(