Skip to content

Commit

Permalink
log exc type
Browse files Browse the repository at this point in the history
  • Loading branch information
kramstrom committed Sep 3, 2024
1 parent d7b968b commit 9082f54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions modal/_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ async def web_server_proxy_app(scope, receive, send):

try:
if scope["type"] == "lifespan":
print("lifespan is not implemented")
raise NotImplementedError("lifespan is not implemented")
pass # Do nothing for lifespan events.
elif scope["type"] == "http":
await _proxy_http_request(session, scope, receive, send)
Expand Down
6 changes: 4 additions & 2 deletions modal/_container_io_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def _init(self, container_args: api_pb2.ContainerArguments, client: _Client):
self._fetching_inputs = True

self._client = client
# assert isinstance(self._client, _Client)
assert isinstance(self._client, _Client)

def __new__(cls, container_args: api_pb2.ContainerArguments, client: _Client) -> "_ContainerIOManager":
cls._singleton = super().__new__(cls)
Expand Down Expand Up @@ -672,7 +672,9 @@ def serialize_exception(self, exc: BaseException) -> bytes:
return self.serialize(exc)
except Exception as serialization_exc:
# We can't always serialize exceptions.
return self.serialize(SerializationError(f"Failed to serialize exception {exc}: {serialization_exc}"))
err = f"Failed to serialize exception {exc} of type {type(exc)}: {serialization_exc}"
logger.info(err)
return self.serialize(SerializationError(err))

def serialize_traceback(self, exc: BaseException) -> Tuple[Optional[bytes], Optional[bytes]]:
serialized_tb, tb_line_cache = None, None
Expand Down

0 comments on commit 9082f54

Please sign in to comment.