Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketmaurya committed Sep 27, 2024
1 parent 02f1a5a commit c9a00a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/litserve/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)))


Expand Down Expand Up @@ -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)))

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)))


Expand Down
2 changes: 1 addition & 1 deletion src/litserve/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c9a00a7

Please sign in to comment.