21
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
51
52
53
|
# File 'lib/rookout/interface.rb', line 21
def start options = {}
return unless @rook.nil?
throw_errors = options[:throw_errors] == true
Config.debug = evaluate_flag options[:debug], "ROOKOUT_DEBUG"
print_debug_messages if Config.debug
begin
verify_env
require_relative "rookout_singleton"
configure options
rook = RookoutSingleton.instance
@start_options[throw_errors: throw_errors]
rook.connect(**@start_options)
rescue LoadError
raise if throw_errors
$stderr.puts "[Rookout] Failed to load Rookout. Please make sure to force build native extensions by setting" \
"'bundle config force_ruby_platform true'"
rescue RookMissingToken, RookInvalidToken, RookInvalidOptions,
RookVersionNotSupported, RookBadProtobuf, RookWebSocketError => e
raise if throw_errors
$stderr.puts "[Rookout] Failed to start Rookout: #{e.message}"
rescue RookCommunicationException => e
raise if throw_errors
Logger.instance.warning "[Rookout] #{e.message}"
rescue Exception => e
$stderr.puts e.full_message if Config.debug
raise if throw_errors
end
end
|