From 88518c5a4fa4fa9d841bb0d1c8add9fa2234530c Mon Sep 17 00:00:00 2001 From: pdp8 Date: Wed, 20 Dec 2023 11:20:50 +0100 Subject: follow, announce, delete fixed --- helpers.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'helpers.rb') diff --git a/helpers.rb b/helpers.rb index 1f106a7..09b0d42 100644 --- a/helpers.rb +++ b/helpers.rb @@ -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 -- cgit v1.2.3