appfuel 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/lib/appfuel/application/dispatcher.rb +29 -3
- data/lib/appfuel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ec72ecc281272f58256fc9f8cf939ecc26eb2e3
|
4
|
+
data.tar.gz: d523670b905bde9b2bdb524c5b0efc21877a6dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92f47cbb94d2d8a06371b994f9021e5a4ab23c65244deb5464731672cf68f6325308170fcd7e8a5eb7969d3ce7493277f836367940d2440a2e316d7f36b8055f
|
7
|
+
data.tar.gz: 3fa9c1990b8caa00dfadd7d2f8271d10a196e15f82fefeff709d2f375e93157cdf1e684d183fe0e3c885c5b82c4a244a62a9322c6b05e870497336fa7ca1ffe4
|
data/CHANGELOG.md
CHANGED
@@ -5,10 +5,16 @@ All notable changes to this project will be documented in this file. (Pending ap
|
|
5
5
|
|
6
6
|
|
7
7
|
# Releases
|
8
|
-
## [[0.6.9]](https://github.com/rsb/appfuel/releases/tag/0.6.
|
8
|
+
## [[0.6.9]](https://github.com/rsb/appfuel/releases/tag/0.6.10) 2017-09-21
|
9
|
+
### Added
|
10
|
+
- adding error handling lambda that can be injected into the container and used
|
11
|
+
in the two different rescue blocks of the dispatcher
|
12
|
+
|
13
|
+
## [[0.6.9]](https://github.com/rsb/appfuel/releases/tag/0.6.9) 2017-09-12
|
14
|
+
### Fixed
|
9
15
|
- `web_api` fix content_type check for json
|
10
16
|
|
11
|
-
## [[0.6.8]](https://github.com/rsb/appfuel/releases/tag/0.6.
|
17
|
+
## [[0.6.8]](https://github.com/rsb/appfuel/releases/tag/0.6.8) 2017-08-24
|
12
18
|
### Fixed
|
13
19
|
- `batch_get` typo fixed in dynamodb params requested_items to request_items
|
14
20
|
|
@@ -8,14 +8,40 @@ module Appfuel
|
|
8
8
|
action = container[:action_loader].call(request.namespace, container)
|
9
9
|
response = action.run(request.inputs)
|
10
10
|
rescue Appfuel::Handler::HandlerFailure => e
|
11
|
-
|
11
|
+
error_handler_key = :dispatcher_action_error_handler
|
12
|
+
response = handle_exception(error_handler_key, e, container)
|
12
13
|
rescue => e
|
13
|
-
|
14
|
-
response =
|
14
|
+
error_handler_key = :dispatcher_general_error_handler
|
15
|
+
response = handle_exception(error_handler_key, e, container)
|
15
16
|
end
|
16
17
|
|
17
18
|
response
|
18
19
|
end
|
20
|
+
|
21
|
+
def handle_exception(error_handler_key, e, container)
|
22
|
+
logger = container[:logger]
|
23
|
+
load_error_handler(error_handler_key, container).call(e, logger)
|
24
|
+
if error_handler_key == :dispatcher_action_error_handler
|
25
|
+
return e.response
|
26
|
+
end
|
27
|
+
|
28
|
+
Appfuel::ResponseHandler.new.error(e)
|
29
|
+
end
|
30
|
+
|
31
|
+
def load_error_handler(key, container)
|
32
|
+
handler = default_exception_handler
|
33
|
+
if container.key?(key)
|
34
|
+
handler = container[key]
|
35
|
+
end
|
36
|
+
handler
|
37
|
+
end
|
38
|
+
|
39
|
+
def default_exception_handler
|
40
|
+
->(e, logger = nil) {
|
41
|
+
logger ||= Logger.new(STDOUT)
|
42
|
+
logger.error "#{e.class.to_s} #{e.to_s} #{e.backtrace.join("\n")}"
|
43
|
+
}
|
44
|
+
end
|
19
45
|
end
|
20
46
|
end
|
21
47
|
end
|
data/lib/appfuel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appfuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Scott-Buccleuch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|