From b5ac24f54a6d057ab9e0831d321afdeddd1f1f1d Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sun, 21 Apr 2024 05:12:03 -0700 Subject: [PATCH] Rescue `CommandNotInstalled` exceptions and print a regular error. --- lib/ronin/repos/cli/commands/install.rb | 2 +- lib/ronin/repos/cli/commands/update.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ronin/repos/cli/commands/install.rb b/lib/ronin/repos/cli/commands/install.rb index 9896ee5..ea39e40 100644 --- a/lib/ronin/repos/cli/commands/install.rb +++ b/lib/ronin/repos/cli/commands/install.rb @@ -63,7 +63,7 @@ class Install < Command def run(uri) log_info "Installing repository from #{uri} ..." cache_dir.install(uri) - rescue CommandFailed => error + rescue CommandNotInstalled, CommandFailed => error print_error(error.message) exit(-1) end diff --git a/lib/ronin/repos/cli/commands/update.rb b/lib/ronin/repos/cli/commands/update.rb index d86faaf..a8b1873 100644 --- a/lib/ronin/repos/cli/commands/update.rb +++ b/lib/ronin/repos/cli/commands/update.rb @@ -77,7 +77,7 @@ def run(name=nil) begin repo.update - rescue CommandFailed => error + rescue CommandNotInstalled, CommandFailed => error log_error("failed to update repository #{repo}: #{error.message}") end end