Skip to content

Commit ad12ab6

Browse files
committed
Code style fixes
1 parent 01f921a commit ad12ab6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

core/lib/testcontainers/network.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class NetworkInUseError < NetworkError; end
1515
class Network
1616
extend Forwardable
1717
include Enumerable
18+
1819
DEFAULT_DRIVER = "bridge"
1920
SHARED_NAME = "testcontainers-shared-network"
2021

@@ -155,14 +156,12 @@ def close(force: false)
155156

156157
@mutex.synchronize do
157158
@docker_network&.tap do |net|
158-
begin
159-
removal_method = force ? :delete : :remove
160-
net.public_send(removal_method)
161-
rescue Docker::Error::NotFoundError
162-
# Swallow missing network errors so cleanup stays idempotent
163-
rescue Docker::Error::ConflictError, Excon::Error::Forbidden => e
164-
raise NetworkInUseError, "Network '#{@name}' is in use: #{e.message}"
165-
end
159+
removal_method = force ? :delete : :remove
160+
net.public_send(removal_method)
161+
rescue Docker::Error::NotFoundError
162+
# Swallow missing network errors so cleanup stays idempotent
163+
rescue Docker::Error::ConflictError, Excon::Error::Forbidden => e
164+
raise NetworkInUseError, "Network '#{@name}' is in use: #{e.message}"
166165
end
167166
ensure
168167
@docker_network = nil

0 commit comments

Comments
 (0)