aldous 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4ac11d7020bca30f4a28b5a3bca292e92ce4422
4
- data.tar.gz: 4dc1ba4b25bd15301374d4715419803521af1949
3
+ metadata.gz: ad59fe847c225edf9e77a544e8ae38cdfae05843
4
+ data.tar.gz: 9cdc0da0f0a9bfa0ad03e86ee6b978cc18c84ba9
5
5
  SHA512:
6
- metadata.gz: 386504b64bb33f3f6f5471c28b45e0a4af9c94a2195da419ad6a7422f3314c95890e15faad9592d742132f9b9f327d3335f0cfa423e614e1084838ee955d059c
7
- data.tar.gz: 8fc61614c1d8d1642da533849c96982fe64ac9ef59f86629438ef528e4af0c1058bf3ef0d2e27bafa50bbba9d84a18c320c7143e3c8bcafac2e0c9516226d30e
6
+ metadata.gz: 8fbcee0cfd3c357e45a27426c1e210857c7d8744b9dcdb196ea7465cc9954dca8412588456355f7de9f0a1390528c183ee283c4a70354c1e89d977184c019032
7
+ data.tar.gz: 63a7b7c8b97c949e3fe4a821011d411700bd719f066fca080c85c09052f67c5c5213c9f7590fead023c8c4e0f1e72d3e428d13751015e3d279b5fa14150cb079
@@ -6,11 +6,13 @@ module Aldous
6
6
  class Configuration
7
7
  attr_accessor :error_reporter,
8
8
  :logger,
9
- :controller_methods_exposed_to_action
9
+ :controller_methods_exposed_to_action,
10
+ :error_handler
10
11
 
11
12
  def initialize
12
13
  @error_reporter = ::Aldous::DummyErrorReporter
13
14
  @logger = ::Aldous::StdoutLogger
15
+ @error_handler = nil
14
16
 
15
17
  @controller_methods_exposed_to_action = [:params, :session, :cookies, :request, :response]
16
18
  end
@@ -21,6 +21,21 @@ module Aldous
21
21
 
22
22
  def perform
23
23
  respondable.action(controller).execute
24
+ rescue => e
25
+ LoggingWrapper.log(e)
26
+ error_handler = ::Aldous.configuration.error_handler
27
+
28
+ if error_handler.kind_of?(Class) && error_handler.ancestors.include?(Aldous::Respondable::Base)
29
+ view_builder.build(error_handler, errors: [e]).action(controller).execute
30
+ else
31
+ controller.head :internal_server_error
32
+ end
33
+ end
34
+
35
+ private
36
+
37
+ def view_builder
38
+ @view_builder ||= Aldous::ViewBuilder.new(controller.view_context, default_view_data)
24
39
  end
25
40
  end
26
41
  end
@@ -1,3 +1,3 @@
1
1
  module Aldous
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aldous
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Skorkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler