effective_resources 2.34.6 → 2.35.0

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: 3a79c20ed1ee3e1431b0bd8c48b3dba8e79b32399b47ae79112c0a12442f1086
4
- data.tar.gz: d26fa6a177b49e83a063dd109c96188455817537c77ade219a54004ebc90dff9
3
+ metadata.gz: ac9ab4beea90ef5e4c0bebd0ebb283b7315db417ced8324988c237e80825d3f6
4
+ data.tar.gz: b348baf50f92881cebbe44245a6a31dd623ca71b1d6810cff113143618dcea7f
5
5
  SHA512:
6
- metadata.gz: caaf3fa64b831e26364daaa80fede1bb5555de2425fcd201bcd3a8e364bb6af2dff1d52f29c2332504816317c59972a80c45fbb64596c91c9b7ef84f62212f78
7
- data.tar.gz: 6c8be7d92251017a58bc2cf6e0e5a8125a63b12225e9b187ad2f2809972d5ed2aa839126580c9b0ffde69a82d1d9b9b0eee0d902b780166ec0abfde83c10c11a
6
+ metadata.gz: 4433a09b0d883ba4032b771cb0c795a6c5dc93b9d454ba23f8a82ecb54df5ee7dccb5e743e5b963e90007155ef8243c7616e0933cad46a88dfcf70d9265c1a81
7
+ data.tar.gz: b07e18cdd584d8f536a0bd6492358bc9b35bb6cc24765668e6c7370d33c9bb3111380368a8340830bc1e769af3ea0e5aadcc688d68a764f283a8a58c27ef3c1e
@@ -77,7 +77,7 @@ module Effective
77
77
 
78
78
  def notify_exception(exception, resource, action)
79
79
  if defined?(ExceptionNotifier)
80
- ExceptionNotifier.notify_exception(exception, env: request.env, data: { resource: resource, action: action })
80
+ EffectiveResources.send_error(exception, resource: resource, action: action)
81
81
  else
82
82
  raise(exception)
83
83
  end
@@ -98,7 +98,7 @@ module ActsAsJobStatus
98
98
 
99
99
  if job_status == :error
100
100
  EffectiveLogger.error(exception.message, associated: self) if defined?(EffectiveLogger)
101
- ExceptionNotifier.notify_exception(exception, data: { id: id, class_name: self.class.name }) if defined?(ExceptionNotifier)
101
+ EffectiveResources.send_error(exception, id: id, class_name: self.class.name)
102
102
  end
103
103
 
104
104
  if job_status == :error && !ENV['TESTING_ACTS_AS_JOB_STATUS']
@@ -101,11 +101,11 @@ module EffectiveGem
101
101
 
102
102
  if associated.kind_of?(ActiveRecord::Base)
103
103
  EffectiveLogger.error(e.message, associated: associated, details: { email: email }) if defined?(EffectiveLogger)
104
- ExceptionNotifier.notify_exception(e, data: { email: email, associated_id: associated.id, associated_type: associated.class.name }) if defined?(ExceptionNotifier)
104
+ EffectiveResources.send_error(e, email: email, associated_id: associated.id, associated_type: associated.class.name)
105
105
  else
106
106
  args_to_s = args.to_s.gsub('<', '').gsub('>', '')
107
107
  EffectiveLogger.error(e.message, details: { email: email, args: args_to_s }) if defined?(EffectiveLogger)
108
- ExceptionNotifier.notify_exception(e, data: { email: email, args: args_to_s }) if defined?(ExceptionNotifier)
108
+ EffectiveResources.send_error(e, email: email, details: args_to_s)
109
109
  end
110
110
 
111
111
  raise(e) unless Rails.env.production? || Rails.env.staging?
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.34.6'.freeze
2
+ VERSION = '2.35.0'.freeze
3
3
  end
@@ -235,6 +235,25 @@ module EffectiveResources
235
235
  et(resource, attribute).pluralize.downcase
236
236
  end
237
237
 
238
+ def self.send_error(exception, **tags)
239
+ if defined?(Tenant)
240
+ tags = { tenant: Tenant.current || 'none' }.merge(tags)
241
+ end
242
+
243
+ tags = tags.transform_values(&:to_s)
244
+
245
+ if defined?(ExceptionNotifier)
246
+ ExceptionNotifier.notify_exception(exception, data: tags)
247
+ end
248
+
249
+ if defined?(Appsignal)
250
+ Appsignal.send_error(exception) do
251
+ Appsignal.add_tags(tags)
252
+ Appsignal.add_custom_data(tags)
253
+ end
254
+ end
255
+ end
256
+
238
257
  def self.cache_key(*keys)
239
258
  if defined?(Tenant)
240
259
  [Tenant.current] + Array(keys).flatten
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.34.6
4
+ version: 2.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-18 00:00:00.000000000 Z
11
+ date: 2026-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails