Skip to content

Commit

Permalink
[MOD-3624] fix: properly handle optional[bytes] in handle_input_excep…
Browse files Browse the repository at this point in the history
…tion (#2175)
  • Loading branch information
thundergolfer committed Aug 31, 2024
1 parent 17fb35f commit 876d6c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modal/_container_io_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,16 @@ async def handle_input_exception(
repr_exc = repr_exc[: MAX_OBJECT_SIZE_BYTES - 1000]
repr_exc = f"{repr_exc}...\nTrimmed {trimmed_bytes} bytes from original exception"

data: bytes = self.serialize_exception(exc) or b""
data_result_part = await self.format_blob_data(data)
results = [
api_pb2.GenericResult(
status=api_pb2.GenericResult.GENERIC_STATUS_FAILURE,
exception=repr_exc,
traceback=traceback.format_exc(),
serialized_tb=serialized_tb,
tb_line_cache=tb_line_cache,
**await self.format_blob_data(self.serialize_exception(exc)),
**data_result_part,
)
for _ in io_context.input_ids
]
Expand Down

0 comments on commit 876d6c0

Please sign in to comment.