Skip to content
Snippets Groups Projects
Verified Commit 81bb27ef authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

api: Add a handler for EOFError on requests

Will have to decide on a proper exception to raise in this scenario,
just to make it a bit more logical about what's going on from the
applications point-of-view.
parent 1acda6ca
No related branches found
No related tags found
No related merge requests found
Pipeline #3695 failed
......@@ -220,7 +220,12 @@ module MatrixSdk
raise MatrixConnectionError, "Server still too busy to handle request after #{failures} attempts, try again later" if failures >= 10
print_http(request)
response = http.request request
begin
response = http.request request
rescue EOFError => e
logger.error 'Socket closed unexpectedly'
raise e
end
print_http(response)
data = JSON.parse(response.body, symbolize_names: true) rescue nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment