brokepoint 0.0.7 → 0.0.8
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 +4 -4
- data/brokepoint.gemspec +1 -1
- data/javascript/load_brokepoint.js +47 -0
- data/lib/brokepoint/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c05ef2ca808c3809c2585fc3cda62ce3392a3f03c2a5218995deac5ad870211
|
4
|
+
data.tar.gz: 146b934a814e83e11e19d5d1b7eed2145a127e58ac3af333ea758c42f06dc3ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3c440626beeff27ebf18e76c05f38301c6dbc68a44425d4707c03a04c3ce270946e2e2637abe137e290dad31572edfb44aa52a9004ce9289e79a9e41a9ca6c9
|
7
|
+
data.tar.gz: 95a93be172d490db38196e8e2fc1c990b493142eb7808dd9b00ec5597cc8389366c5b521bb4d81b58292c8181b3b6db0a691310c64311b68bc02f9d02da999e1
|
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,47 @@
|
|
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
|
+
}
|
36
|
+
|
37
|
+
init() {
|
38
|
+
window.addEventListener("unhandledrejection", (event) => this.recordError(event));
|
39
|
+
|
40
|
+
window.onerror = (message, source, lineno, colno, error) => { this.recordError({ message, source, lineno, colno, error }) }
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
const brokepoint = new Brokepoint();
|
45
|
+
brokepoint.init();
|
46
|
+
|
47
|
+
window.brokepoint = brokepoint;
|
data/lib/brokepoint/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane P
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-09-02 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
|