iberianpig/fusuma · error · InvalidFileError

Invalid syntax: #{path} #{e.message}

Error message

Invalid syntax: #{path} #{e.message}

What it means

Error "Invalid syntax: #{path} #{e.message}" thrown in iberianpig/fusuma.

Source

Thrown at lib/fusuma/config.rb:117

    # @return [Hash] If check passes
    # @raise [InvalidFileError] If check does not pass
    #: (String) -> Array[Hash[Symbol, untyped]]
    def validate(path)
      duplicates = []
      YAMLDuplicationChecker.check(File.read(path), path) do |ignored, duplicate| # steep:ignore UnexpectedBlockGiven
        MultiLogger.error "#{path}: #{ignored.value} is duplicated"
        duplicates << duplicate.value
      end
      raise InvalidFileError, "Detect duplicate keys #{duplicates}" unless duplicates.empty?

      yamls = YAML.load_stream(File.read(path)).compact # steep:ignore NoMethod
      yamls.map do |yaml|
        raise InvalidFileError, "Invalid config.yml: #{path}" unless yaml.is_a? Hash

        yaml.deep_symbolize_keys
      end
    rescue Psych::SyntaxError => e
      raise InvalidFileError, "Invalid syntax: #{path} #{e.message}"
    end

    # @param index [Index]
    #: (Fusuma::Config::Index) -> (String | Hash[untyped, untyped] | Integer | Float)?
    def search(index)
      return nil if index.nil? || index.keys.empty?
      @searcher.search_with_cache(index, location: keymap)
    end

    # @param index [Config::Index]
    # @return Symbol
    def find_execute_key(index)
      @execute_keys ||= Plugin::Executors::Executor.plugins.map do |executor|
        executor.new.execute_keys
      end.flatten

      @cache_execute_keys ||= {} #: Hash[String, untyped]

View on GitHub (pinned to 43a7eb04fe)

Solutions

  1. Fix the YAML syntax error in the file at the reported path; the parser message included in the error shows the line and column.
  2. Check for common mistakes: tabs instead of spaces, unbalanced quotes or brackets, and incorrect indentation.
  3. Validate the file with a YAML parser until it parses without errors.

When it happens

Trigger: Thrown at lib/fusuma/config.rb:117 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iberianpig/fusuma@43a7eb04fe (2026-08-23). Data as JSON: /api/errors/a397459be09fba52. Report an issue: GitHub.