summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-12-20 11:20:50 +0100
committerpdp8 <pdp8@pdp8.info>2023-12-20 11:20:50 +0100
commit88518c5a4fa4fa9d841bb0d1c8add9fa2234530c (patch)
tree8a808ff352841779637c6bd1aa171e94c2c55cdf /helpers.rb
parent443b6fd42abf9cb1392125199cca449702898327 (diff)
follow, announce, delete fixed
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb11
1 files changed, 9 insertions, 2 deletions
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