Comments (6)
To troubleshoot your code I suggest to use the function log() as implemented in HelloWorld.
Unhandled - The runtime didn't handle the error. For example, the function ran out of memory or timed out.
from aws-lambda-swift-sprinter.
For AsyncCodableLambda
you need to call the completion handler. Can you provide the code?
Are you sure the db is reachable from the AWS Lambda?
You need to be sure that the Postgres library you are using is based on SwiftNIO 2.0.
from aws-lambda-swift-sprinter.
Hi,
I am using HellowWorld Example's sample code only for AsyncLambda ... Just one line of change in main.swift
sprinter.register(handler: "helloWorld4", lambda: asyncDictLambda)
uncommented above line and commented syncLambda line
And yes it calls completionHandler inside it.
This is the code
let asyncLambda: AsyncCodableLambda<Event, Response> = { event, _, completion in
let message = "Hello World! Hello \(event.name)!"
return completion(.success(Response(message: message)))
}
let asyncDictLambda: AsyncDictionaryLambda = { dictionary, _, completion in
var result = [String: Any]()
if let name = dictionary["name"] as? String {
let message = "Hello World! Hello \(name)!"
result["message"] = message
} else {
completion(.failure(MyLambdaError.invalidEvent))
}
completion(.success(result))
}
returns exact same error message
Thanks
from aws-lambda-swift-sprinter.
just to clarify any confusion. It has nothing to do with Database connection or anything. It's the default code that is given in the main.swift file for asyncLambda i am referring to.
Thanks
from aws-lambda-swift-sprinter.
@mihirpmehta Have you registered the Handler HelloWorld.helloWorld4
?
If not you can just reuse the one you have registered:
sprinter.register(handler: "helloWorld", lambda: asyncDictLambda)
from aws-lambda-swift-sprinter.
Oh. I miss it. I didn't change it in makefile. Thanks a ton
from aws-lambda-swift-sprinter.
Related Issues (17)
- Add support for Swift 5.1 HOT 3
- Improve the Makefile to allow continuous integration by passing parameters
- Add commands in Makefile to improve the deployment from S3.
- Add minimal support for Travis CI and Visual Studio Code Debugging
- Update Swift 5.1 to 5.1.1
- make create_lambda doesn't create the execution role HOT 1
- Update Swift 5.1.1 to 5.1.2 HOT 1
- AWS Linux-Ubuntu - and Layers HOT 3
- Update async-http-client to version 1.0.0 HOT 1
- Database connection in server-less HOT 10
- Test Lambda invocation with Lambci and LocalStack HOT 1
- Evaluate internal WARM performance of LambdaSwiftSprinterNioPlugin with HelloWorld HOT 14
- Build Swift 5.0.3 Release on Docker amazonlinux:2018.03 HOT 1
- Build Swift 5.1 Release on Docker amazonlinux:2018.03 HOT 4
- Performance improvement investigation HOT 4
- Provide a performance comparison by running the same example with different languages. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-lambda-swift-sprinter.