diff options
Diffstat (limited to 'helpers.rb')
-rw-r--r-- | helpers.rb | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -136,7 +136,14 @@ helpers do response = curl( "-H 'Accept: #{accept}' -H 'Host: #{uri.host}' -H 'Date: #{httpdate}' -H 'Signature: #{signed_header}' ", url ) - response ? JSON.parse(response) : nil + return unless response + + begin + JSON.parse(response) + rescue StandardError => e + p url, e + nil + end end def curl(ext, url) @@ -144,7 +151,7 @@ helpers do if $CHILD_STATUS.success? response else - p 'curl error:', url, response + p 'Curl Error:', url, response nil end end |