TheJumpCloud / jumpcloud-ruby-gem

Source code for JumpCloud's Ruby Gem, a Ruby-based SDK for the JumpCloud System Context API
3 stars 7 forks source link

JSON parse exception #3

Closed sportarc closed 6 years ago

sportarc commented 9 years ago

Hi,

When calling def self.get_system_data() using a non-existing system_key, the resulting message is empty apparently.

JSON parse then crashes:

/usr/share/ruby/gems/2.0/gems/json-1.8.2/lib/json/common.rb:155:in initialize': A JSON text must at least contain two octets! (JSON::ParserError) from /usr/share/ruby/gems/2.0/gems/json-1.8.2/lib/json/common.rb:155:innew' from /usr/share/ruby/gems/2.0/gems/json-1.8.2/lib/json/common.rb:155:in parse' from /usr/local/share/ruby/gems/2.0/gems/jumpcloud-0.4.0/lib/jumpcloud.rb:88:inget_system_data' from /usr/local/share/ruby/gems/2.0/gems/jumpcloud-0.4.0/lib/jumpcloud.rb:48:in set_system_name' from ./jumpcloud-settags:3:in

'

You should return an error saying that the system_key doesn't exists instead.

Thanks nicolas

jpvajda commented 6 years ago

This repo is now deprecated you can find support for Ruby here. https://github.com/TheJumpCloud/jcapi-ruby