Handle CLI failure exit status at the top-level script (#28322)

This commit is contained in:
Matt Jankowski
2024-01-26 03:53:44 -05:00
committed by GitHub
parent 881e8c113c
commit 0e0a94f483
27 changed files with 150 additions and 320 deletions

View File

@@ -6,8 +6,13 @@ require_relative '../lib/mastodon/cli/main'
begin
Chewy.strategy(:mastodon) do
Mastodon::CLI::Main.start(ARGV)
Mastodon::CLI::Main.start(ARGV, debug: true) # Enables the script to rescue `Thor::Error`
end
rescue Thor::Error => e
Thor::Shell::Color
.new
.say_error(e.message, :red)
exit(1)
rescue Interrupt
exit(130)
end