Fixing Exceptions and Exception-Handling
This commit is contained in:
parent
ad6f53bab3
commit
cae3692008
|
@ -120,7 +120,7 @@ class DenCli::Interactive
|
|||
return nil if line.nil?
|
||||
begin
|
||||
cur.call *line
|
||||
rescue ::UsageError
|
||||
rescue ::DenCli::UsageError
|
||||
STDERR.puts "! #$!"
|
||||
end
|
||||
true
|
||||
|
|
|
@ -22,7 +22,7 @@ class DenCli::Sub
|
|||
elsif @aliases.has_key? n
|
||||
@aliases[n].help *a
|
||||
else
|
||||
raise UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||
raise DenCli::UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -31,7 +31,7 @@ class DenCli::Sub
|
|||
if @aliases.has_key? n
|
||||
@aliases[n].call *a
|
||||
else
|
||||
raise UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||
raise DenCli::UnknownCommand, "unknown command: #{_full_cmd( [n])[1..-1].join ' '}, available for #{full_cmd[1..-1].join' '}: #{@subs.keys.join ' '}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
class DenCli
|
||||
VERSION = '0.2.0'
|
||||
VERSION = '0.2.1'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue