22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/troo/launcher.rb', line 22
def execute!
$stdin, $stdout, $stderr = @stdin, @stdout, @stderr
pad { Troo::CLI::Main.start(@argv) }
@exit_code = 0
rescue ConfigurationNotFound
pad do
puts "Configuration cannot be found, please run " \
"`troo wizard` to get started."
end
rescue ConfigurationAborted
pad { puts 'Configuration wizard aborted.' }
rescue Redis::CannotConnectError
pad { puts 'Cannot connect to Redis database.' }
rescue ExpiredAccessToken
pad do
puts "Your Trello access token has expired, please run " \
"`troo wizard` for help, or manually renew."
end
rescue EndpointNotFound
pad do
puts "An unrecoverable error has occurred due to programmer " \
"error. Please report this issue at:\n\n" \
"https://github.com/gavinlaking/troo/issues\n\n" \
"Thank you.\n"
end
ensure
$stdin, $stdout, $stderr = STDIN, STDOUT, STDERR
@kernel.exit(@exit_code)
end
|