Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use faraday error wrappers.

Pavel Balashov0c2021fabaa7
diff --git a/app/services/oauth_clients/connection_manager.rb b/app/services/oauth_clients/connection_manager.rb
index dc05af51fb2..96e8dd16f0e 100644
--- a/app/services/oauth_clients/connection_manager.rb
+++ b/app/services/oauth_clients/connection_manager.rb
@@ -203,9 +203,7 @@ module OAuthClients
ServiceResult.success(result: rack_access_token)
rescue Rack::OAuth2::Client::Error, Faraday::ParsingError => e
service_result_with_error(i18n_rack_oauth2_error_message(e), e.message)
- rescue Timeout::Error, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
- Errno::EINVAL, Errno::ENETUNREACH, Errno::ECONNRESET, Errno::ECONNREFUSED, JSON::ParserError,
- Faraday::ConnectionFailed => e
+ rescue Faraday::TimeoutError, Faraday::ConnectionFailed => e
# Reduce the number of exceptions in the list https://github.com/lostisland/faraday-net_http/blob/main/lib/faraday/adapter/net_http.rb
service_result_with_error(
"#{I18n.t('oauth_client.errors.oauth_returned_http_error')}: #{e.class}: #{e.message.to_html}"