Project

General

Profile

Actions

Bug #14436

closed

Hammer should provide more informative message for config file syntax errors

Added by Tomáš Strachota almost 8 years ago. Updated over 7 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 #1

Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/206 added
Actions #2

Updated by The Foreman Bot over 7 years ago

  • Assignee set to Tomáš Strachota
  • Pull request https://github.com/theforeman/hammer-cli/pull/211 added
Actions #3

Updated by Abhijeet Kasurde over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Tomáš Strachota over 7 years ago

  • Has duplicate Bug #12115: badly formatted yaml prevents hammer from running added
Actions #5

Updated by Tomáš Strachota over 7 years ago

  • Bugzilla link set to 1127275
Actions

Also available in: Atom PDF