lib/tggl/client.rb in tggl-0.1.0 vs lib/tggl/client.rb in tggl-0.2.0

- old
+ new

@@ -16,11 +16,11 @@ ) end def eval_context(context) response = eval_contexts([context]).first - raise "Unexpected empty response from Tggl" if response.nil? + raise StandardError.new "Unexpected empty response from Tggl" if response.nil? response end def eval_contexts(contexts) @@ -37,12 +37,12 @@ response = http.request(request) result = JSON.parse(response.body, symbolize_names: true) if response.code.to_i > 200 if result.nil? - raise "Invalid response from Tggl: #{response.code}" + raise StandardError.new "Invalid response from Tggl: #{response.code}" end - raise result['error'] + raise StandardError.new result['error'] end result.map { |flags| Response.new(flags) } end end