Replace silent BaseException swallowing in Docker teardown with structured warning #165
Reference in New Issue
Block a user
Delete Branch "fix/issue-156-teardown-warning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #156.
Summary
bot_bottle/backend/docker/launch.py: replaceexcept BaseException: passin theteardownclosure with awarn()call (imported frombot_bottle.log) that surfaces the container name and operation type ("compose-down") at WARNING level — non-blocking, exception is consumed so the caller's error-propagation contract is unchanged.tests/unit/test_docker_launch_teardown.py: new test that mocks the full launch stack, injects aRuntimeErrorviacompose_down, and asserts the emitted warning contains both the container name and operation label.Changes (1 commit)
9282bcefix: emit WARNING when Docker teardown ExitStack raises (issue #156)Replace the bare `except BaseException: pass` in the `teardown` closure with a `warn()` call that includes the container name and operation type ("compose-down"), so cleanup failures are visible in the log rather than silently discarded. Non-blocking: the exception is consumed and teardown continues, preserving the original error-propagation contract. Add test_docker_launch_teardown.py to lock the new behaviour: it injects a RuntimeError via a mocked `compose_down` callback and asserts the WARNING message contains the container name and operation label.