summaryrefslogtreecommitdiff
path: root/bin/leap
diff options
context:
space:
mode:
Diffstat (limited to 'bin/leap')
-rwxr-xr-xbin/leap21
1 files changed, 19 insertions, 2 deletions
diff --git a/bin/leap b/bin/leap
index 75c14c7..c492127 100755
--- a/bin/leap
+++ b/bin/leap
@@ -78,9 +78,26 @@ module LeapCli::Commands
exit(0)
end
+ # disable GLI error catching
+ ENV['GLI_DEBUG'] = "true"
+ def error_message(msg)
+ end
+
# load commands and run
commands_from('leap_cli/commands')
ORIGINAL_ARGV = ARGV.dup
- exit_status = run(ARGV)
- exit(LeapCli::Util.exit_status || exit_status)
+ begin
+ exit_status = run(ARGV)
+ exit(LeapCli::Util.exit_status || exit_status)
+ rescue StandardError => exc
+ if LeapCli.log_level < 2
+ if exc.respond_to? :log
+ exc.log
+ else
+ puts "%s: %s" % [exc.class, exc.message]
+ end
+ else
+ raise exc
+ end
+ end
end