class Nokogiri::XML::SyntaxError

exceptions are typically stored on Nokogiri::XML::Document#errors.
This class provides information about XML SyntaxErrors. These
##

def error?

return true if this is an error
##
def error?
  level == 2
end

def fatal?

return true if this error is fatal
##
def fatal?
  level == 3
end

def level_to_s

def level_to_s
  case level
  when 3 then "FATAL"
  when 2 then "ERROR"
  when 1 then "WARNING"
  end
end

def location_to_s

def location_to_s
  return nil if nil_or_zero?(line) && nil_or_zero?(column)
  "#{line}:#{column}"
end

def nil_or_zero?(attribute)

def nil_or_zero?(attribute)
  attribute.nil? || attribute.zero?
end

def none?

return true if this is a non error
##
def none?
  level == 0
end

def to_s

def to_s
  message = super.chomp
  [location_to_s, level_to_s, message]
    .compact.join(": ")
    .force_encoding(message.encoding)
end

def warning?

return true if this is a warning
##
def warning?
  level == 1
end