The websocket client is catching errors thrown from within the do block. The outer try catch never gets triggered and the server restarts unexpectedly. The only hack is to use a condition variable. This adds even more boilerplate. Can we fix this?
while true
try
WebSockets.open("wss://ws-feed.exchange.coinbase.com") do ws
try
error("test")
for msg in ws
end
catch e
@info "Inner try catch"
rethrow(e)
end
end
catch e
@info "Outer try catch"
rethrow(e)
end
@info "Restarting"
sleep(2)
end