Skip to content
Snippets Groups Projects
Verified Commit f4463d5f authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Handle empty response bodies correctly

parent c1416393
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,7 @@ module LiudeskCMDB ...@@ -80,7 +80,7 @@ module LiudeskCMDB
response.body response.body
rescue Net::HTTPClientException, Net::HTTPFatalError rescue Net::HTTPClientException, Net::HTTPFatalError
begin begin
body = JSON.parse(response.body) body = JSON.parse(response.body) unless response.body.empty?
rescue StandardError => e rescue StandardError => e
logger.debug "Failed to parse error response - #{e.class}: #{e}" logger.debug "Failed to parse error response - #{e.class}: #{e}"
body = response.body body = response.body
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment