Project

General

Profile

Actions

Bug #4556

closed

Nil error for command with no description

Added by David Davis about 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Create an API endpoint with no description for its apidoc. Then create a command with no description. When you run the help menu, you get the following error. It took me a while to debug and figure out it was because of the missing description. We should probably at least have a more helpful error message (e.g. "No description for command").

```
NoMethodError (undefined method `each_line' for nil:NilClass):
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/help.rb:83:in `block in add_list'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/help.rb:81:in `each'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/help.rb:81:in `add_list'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:95:in `add_list'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/help.rb:47:in `help'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:100:in `help'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/exception_handler.rb:71:in `handle_help_wanted'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/exception_handler.rb:25:in `handle_exception'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:167:in `handle_exception'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:26:in `rescue in run'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
/home/dadavis/Projects/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
/home/dadavis/Projects/hammer-cli/bin/hammer:77:in `<top (required)>'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/bin/hammer:23:in `load'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/bin/hammer:23:in `<main>'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/bin/ruby_executable_hooks:15:in `eval'
/home/dadavis/.rvm/gems/ruby-1.9.3-p448@hammer/bin/ruby_executable_hooks:15:in `<main>'
```

Actions #1

Updated by David Davis about 10 years ago

  • Category set to Hammer core
Actions #2

Updated by Tomáš Strachota about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
  • Target version set to 1.9.0
Actions #3

Updated by Anonymous about 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset foreman:hammer-cli|commit:0302bb4433d809b56cef82afb84aa0543340f7d4.

Actions

Also available in: Atom PDF