Skip to content

Commit 67ec972

Browse files
authored
Merge pull request #16 from djpate/main
fix `send_error_response` method signature
2 parents 54e86b3 + 8529fc4 commit 67ec972

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Make sure the project is built:
137137
make init build
138138
```
139139
Then,
140-
* to run unit tests: `make test`
140+
* to run unit tests: `make test-unit`
141141
* to run integration tests: `make test-integ`
142142
* to run smoke tests: `make test-smoke`
143143

lib/aws_lambda_ric.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def send_init_error_to_server(err)
106106
@lambda_server.send_init_error(error_object: ex.to_lambda_response, error: ex)
107107
end
108108

109-
def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active: true)
109+
def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active = true)
110110
error_object = err.to_lambda_response
111111
@lambda_server.send_error_response(
112112
request_id: lambda_invocation.request_id,

lib/aws_lambda_ric/lambda_context.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def initialize(request)
1717
@function_name = ENV['AWS_LAMBDA_FUNCTION_NAME']
1818
@memory_limit_in_mb = ENV['AWS_LAMBDA_FUNCTION_MEMORY_SIZE']
1919
@function_version = ENV['AWS_LAMBDA_FUNCTION_VERSION']
20-
@identity = JSON.parse(request['Lambda-Runtime-Cognito-Identity']) if request['Lambda-Runtime-Cognito-Identity']
21-
@client_context = JSON.parse(request['Lambda-Runtime-Client-Context']) if request['Lambda-Runtime-Client-Context']
20+
@identity = JSON.parse(request['Lambda-Runtime-Cognito-Identity']) unless request['Lambda-Runtime-Cognito-Identity'].to_s.empty?
21+
@client_context = JSON.parse(request['Lambda-Runtime-Client-Context']) unless request['Lambda-Runtime-Client-Context'].to_s.empty?
2222
end
2323

2424
def get_remaining_time_in_millis

0 commit comments

Comments
 (0)