Handle CLI failure exit status at the top-level script (#28322)
This commit is contained in:
parent
881e8c113c
commit
0e0a94f483
27 changed files with 150 additions and 320 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue