brokepoint 0.0.7 → 0.0.9

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: e1a9c0b3a99be5d37094f6131690e805054679149c65b89f44f6569c57d304d2
4
- data.tar.gz: f1019a9f0dc8a686816671e65a1815b446281e7d509840e97fa67c77412007ad
3
+ metadata.gz: b7e17f3b9ce38b61592b806a1c1681030742932e4a5d8920cd18919c8ceaf7ad
4
+ data.tar.gz: 681e484dbee840969e286d21383e7f9a1a95dbf26ebc2128592ccb7211df4805
5
5
  SHA512:
6
- metadata.gz: 200e448f4245b71f40e187c4c98f095d88a8152bec4a6d04c8a0fcce96c7ace41348ce91f9874e2c4b7687c8c6ef143d945eee58b967f6ebf0b4d6d565e124e1
7
- data.tar.gz: 847797b0d789df43993398994422653b5653c681eca0dc9db0fea5a5806a3762e357e938d66b6681efa7abae268143eade4dd2b02fa8d8380ebb41b5688c2534
6
+ metadata.gz: 5aa8e5629adb275aecfd8d6a4b8cfaca4ce45a86204ef762ec3ff694c5f668206ba80e1b9ce66ebf0867bd22658ac316fc2d1a9a89a80c90a6a99050ce76a21f
7
+ data.tar.gz: 5445ff4caff1ba8ef40e48c12aced0c59b0b78927f25b9f9d33c2a9bd70d6a682adb1152e83095184b07064aea49c65eaa9e1990b04caa32b04f997f0162a9cd
data/brokepoint.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.summary = "Use this gem to capture errors, exceptions, and logs and send them to your Brokepoint install"
7
7
  s.authors = ["Shane P"]
8
8
  s.email = 'shane@shane.computer'
9
- s.files = Dir['lib/**/*.rb', '*.gemspec']
9
+ s.files = Dir['lib/**/*.rb', '*.gemspec', 'javascript/**/*.js']
10
10
  s.homepage = 'https://rubygems.org/gems/brokepoint'
11
11
  s.platform = Gem::Platform::RUBY
12
12
  s.license = nil
@@ -0,0 +1,48 @@
1
+ class Brokepoint {
2
+ recordError(error) {
3
+ let errorPayload = {
4
+ language: 'javascript',
5
+ url: window.location.toString(),
6
+ url_method: 'GET'
7
+ };
8
+
9
+ errorPayload['name'] = error.message;
10
+ errorPayload['raw_body'] = `${error.source}:${error.lineno}`;
11
+
12
+ if (error instanceof PromiseRejectionEvent) {
13
+ errorPayload['name'] = error.reason.code;
14
+ errorPayload['raw_body'] = 'no stacktrace support for promises yet';
15
+ }
16
+
17
+ if (errorPayload['name'] === undefined || errorPayload['raw_body'] === undefined) {
18
+ console.log("Couldn't get enough details about error", error, errorPayload);
19
+ }
20
+
21
+ this.notify(errorPayload);
22
+ }
23
+
24
+ notify(error) {
25
+ fetch(
26
+ this.endpoint,
27
+ {
28
+ method: 'POST',
29
+ body: JSON.stringify({ event: error }),
30
+ headers: {
31
+ "Content-Type": "application/json",
32
+ },
33
+ }
34
+ )
35
+ .catch(error => { console.error('BROKEPOINT: Failed to send error to brokepoint.', error.message) })
36
+ }
37
+
38
+ init() {
39
+ window.addEventListener("unhandledrejection", (event) => this.recordError(event));
40
+
41
+ window.onerror = (message, source, lineno, colno, error) => { this.recordError({ message, source, lineno, colno, error }) }
42
+ }
43
+ }
44
+
45
+ const brokepoint = new Brokepoint();
46
+ brokepoint.init();
47
+
48
+ window.brokepoint = brokepoint;
@@ -1,3 +1,3 @@
1
1
  module Brokepoint
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brokepoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane P
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-28 00:00:00.000000000 Z
10
+ date: 2025-09-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: zeitwerk
@@ -43,6 +43,7 @@ extensions: []
43
43
  extra_rdoc_files: []
44
44
  files:
45
45
  - brokepoint.gemspec
46
+ - javascript/load_brokepoint.js
46
47
  - lib/brokepoint.rb
47
48
  - lib/brokepoint/middleware.rb
48
49
  - lib/brokepoint/notifier.rb