Project

General

Profile

Bug #4556

Nil error for command with no description

Added by David Davis almost 7 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
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>'
```

Associated revisions

Revision 0302bb44 (diff)
Added by Tomas Strachota over 6 years ago

Fixes #4791 #4556 - command description issues

- missing command descriptions from api docs
- exception on empty command description

Revision 61af9ad2
Added by Tomas Strachota over 6 years ago

Merge pull request #96 from tstrachota/command_desc

Fixes #4791 #4556 - command description issues

History

#1 Updated by David Davis almost 7 years ago

  • Category set to Hammer core

#2 Updated by Tomáš Strachota over 6 years ago

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

#3 Updated by Anonymous over 6 years ago

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

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

Also available in: Atom PDF