rookout 0.1.27 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29081116b19d38b4ff177eb1355605b69c735aa29cfe4b883d05099fe3556a5b
4
- data.tar.gz: e39b5d4e540c790d194aea231ddf33a4d2743fa67ce2b42c2043c561e569873c
3
+ metadata.gz: f8bbc125cf28986d8ae700369a4d36c255e3912f0f9abb895ea10206d6090ca8
4
+ data.tar.gz: 3d20369b3dfe6141454e6a5a262defc0f6a0700d37d7ee6936911e4eaca5b510
5
5
  SHA512:
6
- metadata.gz: 1cc4883a3543f2c6026e7c739662ab8a2ca418bad4b9335a285b7bc1b45e2c30ff63359bcd6ebd4b2a490a72dbacd9b8500b7656a343ac5ddf6d8217fbf63e2e
7
- data.tar.gz: 0dffd5e418e7f81f467b1667df7370806458de425e9b2998991798226bbe7ee9367bf639b15c30b53244aa6c3dae0dc7616dd97cce70beef65ac2429cf877109
6
+ metadata.gz: 939d0c89c0683ca263ca0d0c7980c86537d681462d6e81fb447c0598a323fe7897f6342c3d51add8519e06295c33527d7488964b1a0bb448fcdb3b933c86fe24
7
+ data.tar.gz: f7d1228b2cdd81f6fe01a042b3aa38d89e7b6f2312c16cff32107dd6e0c40f951fe2aa67cb746b6f7adf076da245e422a1e3dbaa941063aa34af000db65c3aa5
@@ -29,8 +29,9 @@ module Rookout
29
29
  max_aug_time = configuration["maxAugTime"] || Config.instrumentation_max_aug_time
30
30
 
31
31
  condition_configuration = configuration["conditional"]
32
- raise Exceptions::RookAugInvalidKey.new("conditional", configuration) unless
33
- condition_configuration.nil? || condition_configuration.is_a?(String)
32
+ unless condition_configuration.nil? || condition_configuration.is_a?(String)
33
+ raise Exceptions::RookAugInvalidKey.new("conditional", configuration)
34
+ end
34
35
  condition = condition_configuration.nil? ? nil : Conditions::Condition.new(condition_configuration)
35
36
 
36
37
  rate_limit = create_rate_limit configuration
@@ -47,15 +48,17 @@ module Rookout
47
48
 
48
49
  def create_location configuration, aug
49
50
  name = configuration["name"]
50
- raise Exceptions::RookObjectNameMissing if name.nil?
51
+ raise Exceptions::RookObjectNameMissing, configuration if name.nil?
51
52
 
52
53
  case name
53
54
  when "file_line"
54
55
  return Locations::LocationFileLine.new configuration, @output, aug
55
56
  when "exception_handler"
56
57
  return Locations::LocationExceptionHandler.new configuration, @output, aug
58
+ when "log_handler"
59
+ raise Exceptions::RookUnsupportedLiveLogger
57
60
  else
58
- raise Exceptions::RookUnsupportedLocation if name != "file_line"
61
+ raise Exceptions::RookUnsupportedLocation, configuration if name != "file_line"
59
62
  end
60
63
  end
61
64
 
@@ -128,12 +128,14 @@ module Rookout
128
128
  @ready_event.set
129
129
  end
130
130
 
131
- Logger.instance.info "Connection failed; reason = #{e.message}"
131
+ Logger.instance.warn "Connection failed; reason = #{e.message}"
132
132
  end
133
133
 
134
134
  backoff.after_disconnect
135
135
  Logger.instance.debug "Reconnecting"
136
136
  end
137
+ rescue Exception => e
138
+ Logger.instance.error "Unexpected error in connection_thread", e
137
139
  end
138
140
  # rubocop:enable Style/StderrPuts
139
141
 
@@ -157,7 +159,14 @@ module Rookout
157
159
  ].freeze
158
160
 
159
161
  def connection_pump client
160
- on_outgoing_exit = proc { client.close }
162
+ on_outgoing_exit = proc {
163
+ begin
164
+ client.close
165
+ rescue Exception => e
166
+ Logger.instance.error "Unexpected error exiting outgoing thread", e
167
+ end
168
+ }
169
+
161
170
  @outgoing_thread = Thread.new { outgoing client, on_outgoing_exit }
162
171
  @outgoing_thread.name = "rookout-outgoing-thread"
163
172
 
@@ -5,7 +5,6 @@ module Rookout
5
5
  require "uri"
6
6
 
7
7
  require_relative "../config"
8
- require_relative "../logger"
9
8
  require_relative "../exceptions"
10
9
 
11
10
  class WebsocketClient
@@ -65,7 +64,7 @@ module Rookout
65
64
 
66
65
  begin
67
66
  @driver.close
68
- rescue RuntimeError, Errno::EPIPE
67
+ rescue RuntimeError, Errno::EPIPE, OpenSSL::OpenSSLError
69
68
  # Protocol close may fail if the connection is already closed
70
69
  nil
71
70
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "25edb2f6d66577295d8ee34842e067d6ad046d12".freeze
2
+ COMMIT = "a753176d0b434bab7c3ab0467b5a544276d5a7f0".freeze
3
3
  end
@@ -219,5 +219,11 @@ module Rookout
219
219
  }
220
220
  end
221
221
  end
222
+
223
+ class RookUnsupportedLiveLogger < ToolException
224
+ def initialize
225
+ super "Live Logger is not supported. Try using Rookout Live Debugger instead."
226
+ end
227
+ end
222
228
  end
223
229
  end
@@ -43,7 +43,7 @@ module Rookout
43
43
  STDERR.puts "[Rookout] Failed to start Rookout: #{e.message}"
44
44
  rescue RookCommunicationException => e
45
45
  raise if throw_errors
46
- STDERR.puts "[Rookout] " + e.message
46
+ Logger.instance.warn "[Rookout] " + e.message
47
47
  rescue Exception => e
48
48
  STDERR.puts e.full_message if Config.debug
49
49
  raise if throw_errors
@@ -99,6 +99,7 @@ module Rookout
99
99
  end
100
100
  end
101
101
 
102
+ # rubocop:disable Style/RescueStandardError
102
103
  def log level, message, args
103
104
  level_no = LOG_LEVELS.index level
104
105
  if level_no.nil?
@@ -110,7 +111,11 @@ module Rookout
110
111
 
111
112
  record = LogRecord.new level, message, args
112
113
  @handlers.each { |handler| handler.call record }
114
+ rescue
115
+ # Log may never throw
116
+ nil
113
117
  end
118
+ # rubocop:enable Style/RescueStandardError
114
119
 
115
120
  def build_handlers
116
121
  if Config.logger_log_to_stderr
@@ -62,20 +62,20 @@ module Rookout
62
62
  end
63
63
 
64
64
  def read_key key
65
- if @obj.is_a? Array
65
+ if @obj.is_a?(Array) || @obj.is_a?(String)
66
66
  key_int = key.to_i
67
67
  return RubyObjectNamespace.new @obj[key_int] if key_int >= 0 && key_int < @obj.length
68
68
  raise Exceptions::RookKeyNotFound, key
69
69
 
70
70
  elsif @obj.is_a? Hash
71
71
  return RubyObjectNamespace.new @obj[key] if @obj.key? key
72
- return RubyObjectNamespace.new @obj[key.to_sym] if key.is_a?(String) && @obj.key?(key.to_sym)
72
+ return RubyObjectNamespace.new @obj[key.to_sym] if @obj.key? key.to_s.to_sym
73
73
 
74
74
  @obj.each { |it, value| return RubyObjectNamespace.new value if it.to_s == key }
75
75
 
76
76
  raise Exceptions::RookKeyNotFound, key
77
77
  else
78
- raise Exceptions::RookInvalidObjectForAccess.new(obj.class.to_s, "ReadKey")
78
+ raise Exceptions::RookInvalidObjectForAccess.new(@obj.class.to_s, "ReadKey")
79
79
  end
80
80
  end
81
81
 
@@ -104,7 +104,7 @@ module Rookout
104
104
  PositionMarker.new lineno, iseq
105
105
  elsif suggested_match? location, filename
106
106
  warning = Exceptions::RookSourceFilePathSuggestion.new location.filename, filename
107
- location.notify_warning warning
107
+ location.notify_warning Processor::RookError.new warning
108
108
  # Must return nil in order to skip this script
109
109
  nil
110
110
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.27".freeze
2
+ VERSION = "0.1.30".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rookout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2022-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 3.17.3
75
+ version: 3.19.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 3.17.3
82
+ version: 3.19.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: google-style
85
85
  requirement: !ruby/object:Gem::Requirement