lib/sensu/client/socket.rb
def parse_check_result(data)
        begin
          object = Sensu::JSON.load(data)
          cancel_watchdog
          if object.is_a?(Array)
            object.each do |check|
              process_check_result(check)
            end
          else
            process_check_result(object)
          end
          respond("ok")
        rescue Sensu::JSON::ParseError, ArgumentError => error
          if @protocol == :tcp
            @parse_error = error.to_s
          else
            raise error
          end
        end
      end
# Parse one or more JSON check results. For UDP, immediately
# raise a parser error. For TCP, record parser errors, so the
# connection +watchdog+ can report them.
#
# @param [String] data to parse for a check result.
Parse one or more JSON check results. For UDP, immediately
raise a parser error. For TCP, record parser errors, so the
connection +watchdog+ can report them.
Parse one or more JSON check results . For UDP immediately raise a parser error . For TCP record parser errors so the connection + watchdog + can report them .
def parse_check_result(data)
        begin
          object = Sensu::JSON.load(data)
          cancel_watchdog
          if object.is_a?(Array)
            object.each do |check|
              process_check_result(check)
            end
          else
            process_check_result(object)
          end
          respond("ok")
        rescue Sensu::JSON::ParseError, ArgumentError => error
          if @protocol == :tcp
            @parse_error = error.to_s
          else
            raise error
          end
        end
      end
def parse_check_result ( data ) begin object = Sensu :: JSON . load ( data ) cancel_watchdog if object . is_a? ( Array ) object . each do | check | process_check_result ( check ) end else process_check_result ( object ) end respond ( "ok" ) rescue Sensu :: JSON :: ParseError , ArgumentError => error if @protocol == :tcp @parse_error = error . to_s else raise error end end end
Parse one or more JSON check results.
Parse one or more JSON check results .
data
data to parse for a check result.
data to parse for a check result .