Closed nickthecook closed 4 years ago
Or this little beauty:
$ ops int
File 'ops.yml' does not exist.
Traceback (most recent call last):
5: from /Users/nick/.gem/ruby/2.6.6/bin/ops:23:in `<main>'
4: from /Users/nick/.gem/ruby/2.6.6/bin/ops:23:in `load'
3: from /Users/nick/.gem/ruby/2.6.6/gems/ops_team-0.2.4/bin/ops:8:in `<top (required)>'
2: from /Users/nick/.gem/ruby/2.6.6/gems/ops_team-0.2.4/lib/ops.rb:36:in `run'
1: from /Users/nick/.gem/ruby/2.6.6/gems/ops_team-0.2.4/lib/ops.rb:66:in `action'
/Users/nick/.gem/ruby/2.6.6/gems/ops_team-0.2.4/lib/ops.rb:73:in `actions': undefined method `transform_values' for nil:NilClass (NoMethodError)
And this li'l beau'y:
$ bin/ops exec
Traceback (most recent call last):
4: from bin/ops:8:in `<main>'
3: from /Users/nick/src/ops/lib/ops.rb:32:in `run'
2: from /Users/nick/src/ops/lib/ops.rb:54:in `run_action'
1: from /Users/nick/src/ops/lib/builtins/exec.rb:18:in `run'
/Users/nick/src/ops/lib/builtins/exec.rb:18:in `exec': No such file or directory - (Errno::ENOENT)
$
These three errors are handled properly in 0.9.7.
Most of the time, if something is not as
ops
expects (e.g.ops.yml
not present, the structure of ayml
orjson
file is not whatops
expects, etc.)ops
will exit with a stack trace.For many of these cases,
ops
should be more defensive and print a helpful error, rather than just let the stack trace rise to the top.A
[]: No such method for NilClass
error is not very helpful to the user, butError: expected "actions" section in ops.yml
is.