Use error handler(s) from CLI launch failure (#4581)

* Use error handler(s) from CLI launch failure

* Fix comparison operator
This commit is contained in:
Takashi M 2020-05-27 09:42:45 -07:00 committed by GitHub
parent b75b9491af
commit cb7c3a7530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,12 @@ begin
cli.run
rescue => e
raise e if $DEBUG
STDERR.puts e.message
STDERR.puts e.backtrace.join("\n")
if Sidekiq.error_handlers.length == 0
STDERR.puts e.message
STDERR.puts e.backtrace.join("\n")
else
cli.handle_exception e
end
exit 1
end