class SiteHealth::JSONSyntax

Checks if JSON syntax is valid

Protected Instance Methods

check() click to toggle source
# File lib/site_health/checkers/json_syntax.rb, line 20
def check
  JSON.parse(page.body)
rescue ::JSON::ParserError => e
  add_issue_type(:parse_error, detail: e.message)
end