posthog-ruby 3.5.2 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 635155121c3c193de787f3f18471838ad5899df6eb14ae3d123718769b4f4cd5
4
- data.tar.gz: f61960abcb913b18831c1d3556bd632306bf1a85c73c330c74a97ea3ba70f247
3
+ metadata.gz: 9401944abdf80537015fd06feb6f1ce795bf0c011271f22216537c75a062dcb8
4
+ data.tar.gz: cea7ce9ff778f181f1e011657b1423ffe74ecb530cc1a5213e43b5d1663424ef
5
5
  SHA512:
6
- metadata.gz: 3bea27cd10068987a07a5190124205ba4d35c4992f68f5f9380d1da94cb0319c4fab2f3108789d610b13a9530471d0fefdb6bc2bd80e2da4d4544ff1d7db53a5
7
- data.tar.gz: 8c65fb56ce39d1316d5c86abe7f032ee4aa90aabbe5e1224e8edf2f29549ce932cdbafa254990323b36af8d50a86fccdbdce0ea6c5d9ae46eb005e769012458d
6
+ metadata.gz: a1a717bec693f592ce65145bbb2a41cf7764bbecddfa6eb8ac95aca68ac43f6a36357397106e1929b607495c681448900076e0dd0f024d0d2ee14071f23bc8f7
7
+ data.tar.gz: 4ff35396b4819bd246fa38096b38715863741d7419f798598f75f4e32c28388e5548e5ff9fafa17cd096e9dfb38c6a94eb20d1a58eb04868ed961d5beeaf1d80
@@ -67,7 +67,7 @@ module PostHog
67
67
  'platform' => 'ruby'
68
68
  }
69
69
 
70
- add_context_lines(frame, file, lineno) if File.exist?(file)
70
+ add_context_lines(frame, file, lineno) if frame['in_app'] && File.exist?(file)
71
71
 
72
72
  frame
73
73
  end
@@ -43,8 +43,10 @@ module PostHog
43
43
  consume_message_from_queue! until @batch.full? || @queue.empty?
44
44
  end
45
45
 
46
- res = @transport.send @api_key, @batch
47
- @on_error.call(res.status, res.error) unless res.status == 200
46
+ unless @batch.empty?
47
+ res = @transport.send @api_key, @batch
48
+ @on_error.call(res.status, res.error) unless res.status == 200
49
+ end
48
50
 
49
51
  @lock.synchronize { @batch.clear }
50
52
  end
@@ -50,7 +50,12 @@ module PostHog
50
50
  last_response, exception =
51
51
  retry_with_backoff(@retries) do
52
52
  status_code, body = send_request(api_key, batch)
53
- error = JSON.parse(body)['error']
53
+ error =
54
+ begin
55
+ JSON.parse(body)['error']
56
+ rescue JSON::ParserError
57
+ body
58
+ end
54
59
  should_retry = should_retry_request?(status_code, body)
55
60
  logger.debug("Response status code: #{status_code}")
56
61
  logger.debug("Response error: #{error}") if error
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.5.2'
4
+ VERSION = '3.5.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''