diff --git a/libraries/api_helper.rb b/libraries/api_helper.rb index 69d49341..d521143a 100644 --- a/libraries/api_helper.rb +++ b/libraries/api_helper.rb @@ -87,7 +87,11 @@ def do_request(grafana_options, payload = nil) success: grafana_options[:success_msg], unknown_code: grafana_options[:unknown_code_msg] ) - JSON.parse(response.body) + begin + JSON.parse(response.body) + rescue JSON::ParserError + nil + end rescue BackendError nil end