forest_admin_rails 1.0.0.pre.beta.107 → 1.0.0.pre.beta.108

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: 0c3495c8c8c1e570bbc9cb1532b916b4f0ceda72170de83f517500661abc3a49
4
- data.tar.gz: 69f876f6ed6bfb967565aa88abd396357e73264e9da21b35d6dfee2331d751f8
3
+ metadata.gz: e87756ec78ff02c7240037b26d818aa130e2900a55f58159212dbff4d273faa5
4
+ data.tar.gz: 8115451b60f05c02a74788c7ea033f905b1191148a5d87c0d00ec02b817a8afc
5
5
  SHA512:
6
- metadata.gz: 938d0bfcd56b78b16146cb9a73939b77c5043f59f9f11cf4d1000c48b6e93782986adf3b8e937a86bb5bcd0ceba8abe553cca1fbff9282185c3b0bee991706a9
7
- data.tar.gz: 76238e28cbb169ab8f97cc91616ee260948df96bd289e33f0bd61f55995a84521362efec7df027e24e8f910ab14e614f0f9d4555a38863f58efd812b2043b6a8
6
+ metadata.gz: f5293a6c0ffc132b3dde9215380aa774d8872909e188f3bc8844cdafc269e0c1df3c6a8575b0bb4e57a469fc570f75f0e4ed01b56db4e0dd2a85146e84694d13
7
+ data.tar.gz: ca070b053e9141150d68856757715c83b4413a5153eed531d0d4a263661c811ae3c7711e8f36534980cb83b59a8f973e1c8284ab3a07885e4654355f4bfb3e36
@@ -40,31 +40,32 @@ module ForestAdminRails
40
40
  end
41
41
 
42
42
  def exception_handler(exception)
43
- case exception
44
- when ForestAdminAgent::Http::Exceptions::AuthenticationOpenIdClient,
45
- OpenIDConnect::Exception
46
- data = {
47
- error: exception.message,
48
- error_description: exception.response,
49
- state: exception.status
50
- }
51
- when ForestAdminAgent::Error
52
- data = {
53
- error: exception.message
54
- }
55
- else
56
- data = {
57
- errors: [
58
- {
59
- name: exception.name,
60
- detail: get_error_message(exception),
61
- status: exception.try(:status)
62
- }
63
- ]
64
- }
65
-
66
- data[:errors][0][:data] = exception.try(:data)
67
- end
43
+ data = case exception
44
+ when ForestAdminAgent::Http::Exceptions::AuthenticationOpenIdClient,
45
+ OpenIDConnect::Exception
46
+ {
47
+ error: exception.message,
48
+ error_description: exception.response,
49
+ state: exception.status
50
+ }
51
+ else
52
+ if exception.respond_to?(:name) && exception.name.present?
53
+ {
54
+ errors: [
55
+ {
56
+ name: exception.name,
57
+ detail: get_error_message(exception),
58
+ status: exception.try(:status),
59
+ data: exception.try(:data)
60
+ }
61
+ ]
62
+ }
63
+ else
64
+ {
65
+ error: exception.message
66
+ }
67
+ end
68
+ end
68
69
 
69
70
  unless ForestAdminAgent::Facades::Container.cache(:is_production)
70
71
  ForestAdminAgent::Facades::Container.logger.log('Debug', exception.full_message)
@@ -45,9 +45,10 @@ module ForestAdminRails
45
45
 
46
46
  begin
47
47
  ForestAdminRails::CreateAgent.setup!
48
- rescue StandardError
48
+ rescue StandardError => e
49
49
  logger = ActiveSupport::Logger.new($stdout)
50
- logger.warn 'WARNING -- : An error has occurred during setup of the Forest Admin agent.'
50
+ logger.warn 'An error has occurred during setup of the Forest Admin agent.'
51
+ raise e.message
51
52
  end
52
53
 
53
54
  sse = ForestAdminAgent::Services::SSECacheInvalidation
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRails
2
- VERSION = "1.0.0-beta.107"
2
+ VERSION = "1.0.0-beta.108"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.107
4
+ version: 1.0.0.pre.beta.108
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-07-01 00:00:00.000000000 Z
12
+ date: 2025-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-configurable