app/libs/agilibox/fcm/request.rb in agilibox-1.4.0 vs app/libs/agilibox/fcm/request.rb in agilibox-1.4.1
- old
+ new
@@ -23,9 +23,12 @@
).body
@response_json = JSON.parse(response_body).deep_symbolize_keys
self
+ rescue JSON::ParserError
+ @response_json = {success: 0, failure: 1, results: [{:error => "InvalidJsonResponse"}]}
+ self
end
def ok?
response_json[:success].positive? && response_json[:failure].zero?
end