activeerror 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/models/active_error/fault.rb +2 -6
- data/lib/active_error/captor.rb +5 -4
- data/lib/active_error/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0361451420586e3b0f513a752050dde415be2ff3c3ae29d4390464a5f74bc4c6'
|
4
|
+
data.tar.gz: 9a517382f5a127069db4442fe8f80d8483998fcfebaf2f129ea90cbd60e7447e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 016eeaffff9029b47edccca17c7b8253f89fe0000e9379a8cda78c1890a0cef4a258e5638afc2483ac84a4cbb34c1d149cd78a593431fb899905bb1371a2b20a
|
7
|
+
data.tar.gz: 561141dea1cf586aca5d63803a2119c0de23b5423cb6a329a30d1e2d710cb825bbcb0d355ce746242a6a3826939ff136e354c5cd9a09d69bd3d088ced7701c01
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
One of the fundemental tools needed to take your Rails app to production is a
|
4
4
|
way to track errors that are triggered. Unfortunately, theres no free, easy,
|
5
|
-
open source way to track them for small or medium apps. Honeybadger
|
6
|
-
|
5
|
+
open source way to track them for small or medium apps. Honeybadger, Sentry,
|
6
|
+
and AppSignal are great, but they are are closed source. With Sentry
|
7
7
|
looking at using your data as training
|
8
8
|
data([link](https://blog.sentry.io/ai-privacy-and-terms-of-service-updates/?original_referrer=https%3A%2F%2Fsentry.io%2F))
|
9
9
|
there should be an easy open source alternative where you control the data.
|
@@ -16,7 +16,7 @@ with is the one baked into Rails that we use everyday in development. So with
|
|
16
16
|
ActiveError, when an error gets raised it's captured and stored in the
|
17
17
|
database (we attempt to group the same error together as Instances to reduce
|
18
18
|
noise) and then we recreate the error and display it using the built in debug
|
19
|
-
view from Rails. Once you've resolved the error you can click "Resolve"
|
19
|
+
view from Rails. Once you've resolved the error you can click "Resolve" which
|
20
20
|
will destroy the record.
|
21
21
|
|
22
22
|
![screenshot 1](https://github.com/npezza93/active_error/blob/main/.github/screenshot1.png)
|
@@ -13,15 +13,11 @@ module ActiveError
|
|
13
13
|
yaml: { unsafe_load: true }
|
14
14
|
|
15
15
|
serialize :backtrace, type: Array, coder: YAML
|
16
|
-
serialize :backtrace_locations, type: Array, coder: YAML,
|
16
|
+
serialize :backtrace_locations, type: Array, coder: YAML,
|
17
17
|
yaml: { unsafe_load: true }
|
18
18
|
serialize :blamed_files, type: Array, coder: YAML
|
19
19
|
|
20
|
-
scope :top_level,
|
21
|
-
left_joins(:parent_cause).where(
|
22
|
-
parent_causes_active_error_faults: { id: nil }
|
23
|
-
)
|
24
|
-
}
|
20
|
+
scope :top_level, -> { where.missing(:parent_cause) }
|
25
21
|
|
26
22
|
def exception
|
27
23
|
ExceptionMock.make(fault: self)
|
data/lib/active_error/captor.rb
CHANGED
@@ -25,7 +25,7 @@ module ActiveError
|
|
25
25
|
|
26
26
|
attr_reader :exception, :request, :capture_instance
|
27
27
|
|
28
|
-
delegate :parameters, to: :request
|
28
|
+
delegate :parameters, to: :request, allow_nil: true
|
29
29
|
|
30
30
|
def fault
|
31
31
|
@fault ||= Fault.default_scoped.find_or_create_by(fault_attrs) do |fault|
|
@@ -38,7 +38,8 @@ module ActiveError
|
|
38
38
|
|
39
39
|
def fault_attrs
|
40
40
|
{ backtrace: exception.backtrace, klass: exception.class.to_s,
|
41
|
-
controller: parameters[:controller],
|
41
|
+
controller: parameters.to_h[:controller],
|
42
|
+
action: parameters.to_h[:action] }
|
42
43
|
end
|
43
44
|
|
44
45
|
def template?
|
@@ -69,10 +70,10 @@ module ActiveError
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def create_instance
|
72
|
-
headers = request
|
73
|
+
headers = request&.env.to_h.
|
73
74
|
slice(*ActionDispatch::Request::ENV_METHODS, "HTTP_USER_AGENT")
|
74
75
|
|
75
|
-
fault.instances.create(headers:, parameters: request
|
76
|
+
fault.instances.create(headers:, parameters: request&.filtered_parameters,
|
76
77
|
url: request.url)
|
77
78
|
end
|
78
79
|
end
|
data/lib/active_error/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeerror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Pezza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
- lib/active_error/version.rb
|
71
71
|
- lib/activeerror.rb
|
72
72
|
- lib/generators/active_error/install/install_generator.rb
|
73
|
-
homepage: https://github.com/npezza93/
|
73
|
+
homepage: https://github.com/npezza93/activeerror
|
74
74
|
licenses:
|
75
75
|
- MIT
|
76
76
|
metadata:
|