Skip to content

Commit

Permalink
Fix checking http response code
Browse files Browse the repository at this point in the history
The status code is a string, not a number.

From ruby docs:

> The HTTP result code string. For example, ‘302’. You can also
determine the response type by examining which response subclass the
response object is an instance of.
  • Loading branch information
sashazykov authored and indrekj committed Apr 4, 2018
1 parent 2e69154 commit c81294c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zipkin/json_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def emit_batch(spans)
request.body = JSON.dump(spans)
response = http.request(request)

if response.code != 202
if response.code != '202'
@logger.error("Received bad response from Zipkin. status: #{response.code}, body: #{response.body.inspect}")
end
rescue StandardError => e
Expand Down

0 comments on commit c81294c

Please sign in to comment.