brokepoint 0.0.12 → 0.0.15

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: d5d673a999efa76dd3a1b880abb6d8c8b851c44bcda796454cd0715181dfef9a
4
- data.tar.gz: 318658a22490201751e8b075b3cc7d5e0870809fb98d103cb4ddc4dd396a52a7
3
+ metadata.gz: 5958c3522308d329a94487f67f3c0d493d461d966f7de088421d094961b6c350
4
+ data.tar.gz: 86f4871cd95f7a4b754897f689e6f9733a576cd71dc55db2be3ae52418755a39
5
5
  SHA512:
6
- metadata.gz: 9f7ebb5d01d41f11edab69f794314d7f093dcbbed8ebb0e587264b108cae999dde2d50859b9ddfe5c0d92daea50238bb76b734b65d99bcdb3a170ccd346fa5ab
7
- data.tar.gz: 1af70d576cdc6824b43d463a6faa8338be608125ef3e0207420e1dd12658642284ebcab941059ca56cdeb26c97e00cc26f02c9e94a9f49f75f5a7caf792cabc2
6
+ metadata.gz: 9b39caa85f38de5ffccb03cbf858a418800fd25cb4bc20d7bbf47171bcf425bf4d69dcf60a53c4c9112dfb361a323bba0d5fdb57afbb49debf5bd4eb7e417393
7
+ data.tar.gz: 607b3270f42ce6288f9e7135b447b6c1cfb3fdf11fcac20463a16d96c912e3fd3691001284104493ccae5711a0be5b1cff3e58f88e1430a27e68af2cd5dcf5cf
@@ -1,5 +1,10 @@
1
1
  class Brokepoint {
2
2
  recordError(error) {
3
+ if (!this.endpoint || this.endpoint.length == 0) {
4
+ console.error("BROKEPOINT: No endpoint configuration. Abandoning attempt to report error.");
5
+ return;
6
+ }
7
+
3
8
  let errorPayload = {
4
9
  language: 'javascript',
5
10
  url: window.location.toString(),
@@ -23,6 +28,10 @@ class Brokepoint {
23
28
  errorPayload['raw_body'] = 'no stacktrace support for promises yet';
24
29
  }
25
30
 
31
+ if (error.hasOwnProperty('grouping_hash')) {
32
+ errorPayload['grouping_hash'] = error.grouping_hash;
33
+ }
34
+
26
35
  if (errorPayload['name'] === undefined || errorPayload['raw_body'] === undefined) {
27
36
  console.log("Couldn't get enough details about error", error, errorPayload);
28
37
  }
@@ -5,19 +5,23 @@ module Brokepoint
5
5
  attr_reader :brokepoint_events_endpoint
6
6
 
7
7
  def initialize
8
- @brokepoint_events_endpoint = URI.parse("#{ENV['BROKEPOINT_URL']}/events")
8
+ @brokepoint_events_endpoint = URI.parse("#{brokepoint_url}/events")
9
9
  end
10
10
 
11
11
  def should_notify?
12
- ENV.key?('BROKEPOINT_URL')
12
+ brokepoint_url.present?
13
13
  end
14
14
 
15
- def notify(name:, raw_body:, url:)
16
- return unless should_notify?
15
+ def notify(name:, raw_body:, url:, grouping_hash: nil)
16
+ unless should_notify?
17
+ Rails.logger.error('Brokepoint is installed, but not configured with a BROKEPOINT_URL, so cannot report event.')
18
+ return
19
+ end
17
20
 
18
21
  event = { name:, raw_body:, url:,
19
22
  project_id: ENV['BROKEPOINT_PROJECT_ID'],
20
- release_version: ENV['BROKEPOINT_RELEASE_VERSION']
23
+ release_version: ENV['BROKEPOINT_RELEASE_VERSION'],
24
+ grouping_hash:
21
25
  }.compact
22
26
 
23
27
  uri = brokepoint_events_endpoint
@@ -30,7 +34,7 @@ module Brokepoint
30
34
  Timeout.timeout(1) {
31
35
  http.request(request)
32
36
  }
33
- rescue Timeout::Error, Errno::ECONNREFUSED, Socket::ResolutionError => exception
37
+ rescue Timeout::Error, Errno::ECONNREFUSED, SocketError, OpenSSL::SSL::SSLError => exception
34
38
  Rails.logger.error("Unable to notify Brokepoint; #{exception.to_s}")
35
39
  end
36
40
 
@@ -39,5 +43,9 @@ module Brokepoint
39
43
  def default_headers
40
44
  {'Content-Type': 'application/json'}
41
45
  end
46
+
47
+ def brokepoint_url
48
+ ENV['BROKEPOINT_URL_INTERNAL'] || ENV['BROKEPOINT_URL']
49
+ end
42
50
  end
43
51
  end
@@ -1,3 +1,3 @@
1
1
  module Brokepoint
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.15'
3
3
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brokepoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane P
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2025-10-21 00:00:00.000000000 Z
11
+ date: 2026-01-02 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: zeitwerk
@@ -37,6 +38,7 @@ dependencies:
37
38
  - - "~>"
38
39
  - !ruby/object:Gem::Version
39
40
  version: '8.0'
41
+ description:
40
42
  email: shane@shane.computer
41
43
  executables: []
42
44
  extensions: []
@@ -54,6 +56,7 @@ licenses:
54
56
  -
55
57
  metadata:
56
58
  rubygems_mfa_required: 'true'
59
+ post_install_message:
57
60
  rdoc_options: []
58
61
  require_paths:
59
62
  - lib
@@ -68,7 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
71
  - !ruby/object:Gem::Version
69
72
  version: '0'
70
73
  requirements: []
71
- rubygems_version: 3.6.1
74
+ rubygems_version: 3.4.20
75
+ signing_key:
72
76
  specification_version: 4
73
77
  summary: Use this gem to capture errors, exceptions, and logs and send them to your
74
78
  Brokepoint install