From d80cd099cafab51e89241c3cb2acee198a64af2e Mon Sep 17 00:00:00 2001 From: Mark Delk Date: Mon, 7 Nov 2022 20:46:18 -0600 Subject: [PATCH] [BUG][RUBY] Fix ruby faraday HTTP 0 issue without libcurl (#13945) * Fix ruby faraday HTTP 0 issue without libcurl * commit generated files --- .../resources/ruby-client/api_client_faraday_partial.mustache | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache index be5e26dcd66..8327a3492fa 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -13,7 +13,7 @@ end unless response.success? - if response.status == 0 + if response.status == 0 && response.respond_to?(:return_message) # Errors from libcurl will be made visible here fail ApiError.new(code: 0, message: response.return_message) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 5a52719c53b..8f0d3598b45 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -58,7 +58,7 @@ module Petstore end unless response.success? - if response.status == 0 + if response.status == 0 && response.respond_to?(:return_message) # Errors from libcurl will be made visible here fail ApiError.new(code: 0, message: response.return_message)