faastruby 0.5.4 → 0.5.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/faastruby/server/response.rb +10 -0
- data/lib/faastruby/server/runner.rb +1 -1
- data/lib/faastruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a491f4abb96d8fa8365469a5cd1adec928ba2c775e05dedafbcce10924ef889
|
4
|
+
data.tar.gz: e20f906502710fb4b7bb5803a47e4844d183e254305766e8f5fff94341b5ef63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77f0c2999f8648cad2055da5a36917ece93849b7e243d5d0c512bde0406b2fffeb4a121686b5a420b4a4ed9ed49e3d10af3ada202bda8d2d9528fa3df675b8db
|
7
|
+
data.tar.gz: 22f7921d21da2357857f2b4e66bd0cc0c0334e0c2f610e8c4538abf629874889121e99efc835867a2645a709dce0611784a23568f8f3181ee88e20858698a969
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -24,6 +24,16 @@ module FaaStRuby
|
|
24
24
|
)
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.invalid_response
|
28
|
+
body = {'error' => "Your function must render a response. For example, render text: \"Hello World!\""}
|
29
|
+
body = Oj.dump(body)
|
30
|
+
new(
|
31
|
+
body: body,
|
32
|
+
status: 500,
|
33
|
+
headers: {'Content-Type' => 'application/json'}
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
27
37
|
def self.from_payload(payload)
|
28
38
|
from_json Base64.urlsafe_decode64(payload)
|
29
39
|
end
|
@@ -64,7 +64,7 @@ module FaaStRuby
|
|
64
64
|
function = load_function("#{@function_folder}/handler.rb")
|
65
65
|
function_object.extend(function)
|
66
66
|
response = function_object.handler(event, *args)
|
67
|
-
|
67
|
+
response = FaaStRuby::Response.invalid_response unless response.is_a?(FaaStRuby::Response)
|
68
68
|
rescue Exception => e
|
69
69
|
error = Oj.dump({
|
70
70
|
'error' => e.message,
|
data/lib/faastruby/version.rb
CHANGED