Skip to content

Commit c7b8822

Browse files
author
Kyle Decot
committed
Wraps all of get in a begin/rescue so that we can gracefully fail
1 parent 7b94f7b commit c7b8822

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/kmdata.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def endpoint
1111
end
1212

1313
def get(path, params = {})
14-
path = path_with_params("/api/#{path}.json", params)
1514
begin
15+
path = path_with_params("/api/#{path}.json", params)
1616
response = http.request(Net::HTTP::Get.new(path))
17+
process(JSON.parse(response.body))
1718
rescue Exception => exception
1819
return false
1920
end
20-
process(JSON.parse(response.body))
2121
end
2222

2323
private

0 commit comments

Comments
 (0)