From c9a00a760ee6f056652daca560cc40b27f23fe40 Mon Sep 17 00:00:00 2001 From: Aniket Maurya Date: Fri, 27 Sep 2024 13:19:06 +0530 Subject: [PATCH] rename function --- src/litserve/loops.py | 10 +++++----- src/litserve/utils.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/litserve/loops.py b/src/litserve/loops.py index 215f56f6..7e65ba9f 100644 --- a/src/litserve/loops.py +++ b/src/litserve/loops.py @@ -26,7 +26,7 @@ from litserve import LitAPI from litserve.callbacks import CallbackRunner, EventTypes from litserve.specs.base import LitSpec -from litserve.utils import LitAPIStatus, dump_exceptions +from litserve.utils import LitAPIStatus, dump_exception mp.allow_connection_pickling() @@ -153,7 +153,7 @@ def run_single_loop( "Please check the error trace for more details.", uid, ) - err_pkl = dump_exceptions(e) + err_pkl = dump_exception(e) response_queues[response_queue_id].put((uid, (err_pkl, LitAPIStatus.ERROR))) @@ -226,7 +226,7 @@ def run_batched_loop( "LitAPI ran into an error while processing the batched request.\n" "Please check the error trace for more details." ) - err_pkl = dump_exceptions(e) + err_pkl = dump_exception(e) for response_queue_id, uid in zip(response_queue_ids, uids): response_queues[response_queue_id].put((uid, (err_pkl, LitAPIStatus.ERROR))) @@ -289,7 +289,7 @@ def run_streaming_loop( "Please check the error trace for more details.", uid, ) - response_queues[response_queue_id].put((uid, (dump_exceptions(e), LitAPIStatus.ERROR))) + response_queues[response_queue_id].put((uid, (dump_exception(e), LitAPIStatus.ERROR))) def run_batched_streaming_loop( @@ -362,7 +362,7 @@ def run_batched_streaming_loop( "LitAPI ran into an error while processing the streaming batched request.\n" "Please check the error trace for more details." ) - err_pkl = dump_exceptions(e) + err_pkl = dump_exception(e) response_queues[response_queue_id].put((uid, (err_pkl, LitAPIStatus.ERROR))) diff --git a/src/litserve/utils.py b/src/litserve/utils.py index 84b2b706..ea994d7c 100644 --- a/src/litserve/utils.py +++ b/src/litserve/utils.py @@ -46,7 +46,7 @@ def __reduce__(self): return (HTTPException, (self.status_code, self.detail)) -def dump_exceptions(exception): +def dump_exception(exception): if isinstance(exception, HTTPException): exception = PickleableHTTPException.from_exception(exception) return pickle.dumps(exception)