Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket client hiding errors thrown from within do block #1067

Open
bryaan opened this issue Jun 25, 2023 · 0 comments
Open

WebSocket client hiding errors thrown from within do block #1067

bryaan opened this issue Jun 25, 2023 · 0 comments

Comments

@bryaan
Copy link

bryaan commented Jun 25, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant