Commit 3e540265 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Catch and log exceptions during container cleanup

parent d4f24b7c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -269,9 +269,12 @@ class Container(Item):
		return self

	def __exit__(self, etype: type[BaseException], exc: BaseException, tb: TracebackType) -> None:
		try:
			if self.cid and exc:
				self.show_logs()
			self.stop(rm=True)
		except Exception:
			logging.getLogger(__name__).exception("ignoring exception while stopping")

	@contextmanager
	def started(self) -> Iterator[Container]: