EasyPost/easypost-ruby

NoMethodError in error.rb

Closed this issue · 1 comments

NoMethodError: undefined method `fetch' for nil:NilClass
from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/easypost-2.1.2/lib/easypost/error.rb:17:in `initialize'

.fetch on json_body when it is nil results in the above error being thrown in test. The solution is to set the default value of json_body to {} as so

def initialize(message=nil, http_status=nil, http_body=nil, json_body={})

Thanks! Fixed in fa23479.