bitcoin-dev-project/warnet

catch fewer errors

Closed this issue · 2 comments

I think we need to be less afraid to raise exceptions. try/except blocks like the one below are counter productive. In recent CI runs for example, wait_for_health() fails, meaning apply_network_conditions() is just skipped, but the test continues to run along.

Somewhat related to #198

warnet/src/warnet/server.py

Lines 472 to 485 in 4410200

def thread_start(server: Server, network):
with server.image_build_lock:
try:
wn = server.get_warnet(network)
wn.generate_deployment()
wn.write_fork_observer_config()
wn.warnet_build()
wn.warnet_up()
wn.wait_for_health()
wn.apply_network_conditions()
self.logger.info("Warnet started successfully")
except Exception as e:
trace = traceback.format_exc()
self.logger.error(f"Unhandled exception starting warnet: {e}\n{trace}")

Hi this is a test comment that is very spammy. I should be blocked and banned for 24 hours

Fixed in /dev branch