Project

General

Profile

Actions

Bug #14436

closed

Hammer should provide more informative message for config file syntax errors

Added by Tomáš Strachota almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
-
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

When one of yaml config files has wrong syntax (for example tab instead of space indentation) hammer fails without telling the user what actually happened and which file the issue is in:

/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1 (Psych::SyntaxError)
    from /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
    from /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:318:in `parse'
    from /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:245:in `load'
    from /home/vagrant/hammer/hammer-cli/lib/hammer_cli/settings.rb:37:in `load_from_file'
    from /home/vagrant/hammer/hammer-cli/lib/hammer_cli/settings.rb:20:in `block in load_from_paths'
    from /home/vagrant/hammer/hammer-cli/lib/hammer_cli/settings.rb:16:in `each'
    from /home/vagrant/hammer/hammer-cli/lib/hammer_cli/settings.rb:16:in `load_from_paths'
    from ./bin/hammer:49:in `<main>'

Hammer should print more informative message, for example:

Couldn't load configuration file '/home/vagrant/.hammer/cli_config.yml', please check the file syntax.


Related issues 1 (0 open1 closed)

Has duplicate Hammer CLI - Bug #12115: badly formatted yaml prevents hammer from runningDuplicateTomáš Strachota10/08/2015Actions
Actions

Also available in: Atom PDF