class Haml::Exec::Generic

def get_line(exception)

Returns:
  • (String) - The line number

Parameters:
  • exception (Exception) -- The exception
def get_line(exception)
  # SyntaxErrors have weird line reporting
  # when there's trailing whitespace,
  # which there is for Haml documents.
  return exception.message.scan(/:(\d+)/).first.first if exception.is_a?(::SyntaxError)
  exception.backtrace[0].scan(/:(\d+)/).first.first
end