Skip to content

decode_resource fails when response.body is nil #52

@sergio91pt

Description

@sergio91pt

With the introduction of v1.15.0, some errors started appearing on CI builds of a project using this library for tests. The errors are related to the decode_resource method of the http/client.rb, which seem to indicate that response.body is nil.

NoMethodError:
  undefined method `empty?' for nil:NilClass
# /bundle/ruby/2.4.0/gems/rabbitmq_http_api_client-1.15.0/lib/rabbitmq/http/client.rb:429:in `decode_resource'
# /bundle/ruby/2.4.0/gems/rabbitmq_http_api_client-1.15.0/lib/rabbitmq/http/client.rb:134:in `delete_exchange'
# ./spec/support/helpers/rabbitmq_management.rb:11:in `block in delete_exchanges'
# ./spec/support/helpers/rabbitmq_management.rb:11:in `each'
# ./spec/support/helpers/rabbitmq_management.rb:11:in `delete_exchanges'
# ./spec/integration/consumer/event_consumer_spec.rb:27:in `block (2 levels) in <top (required)>'

The CI job used faraday 1.3.0, faraday-net_http 1.0.1 and faraday_middleware 1.0.0.
Downgrading this library to v1.14.0 fixed the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions