
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
lambda-generator-handler
Advanced tools
Run a generator function as an AWS Lambda function, with added error handling
Run a generator function as an AWS Lambda function, when you are using lambda-proxy integration with API Gateway.
$ npm install --save lambda-generator-handler
Create your AWS Lambda function as a generator and then export it wrapped
by the lambda-generator-handler
package. Note that this library is only
for use when you have configured your endpoint in API Gateway to use
lambda-proxy integration with your Lambda function.
const generatorHandler = require('lambda-generator-handler');
function* someHandler(event) {
// The 'event' arg is the AWS Lambda event object.
// Throw an error if something bad happens.
// Return a result as you normally do from a generator.
return { name: 'the result' };
}
module.exports.handler = generatorHandler(someHandler);
If your handler throws an exception, this wrapper catches it and
returns an error response to AWS Lambda. It checks that the error
message includes a serverless
framework type of error code prefix
(e.g., the [500]
prefix in the message [500] Some error occurred
),
and adds one if none exists. It also turns a DynamoDB
ConditionalCheckFailedException
into a 400 Stale Data
error response.
MIT
FAQs
Run a generator function as an AWS Lambda function, with added error handling
The npm package lambda-generator-handler receives a total of 4 weekly downloads. As such, lambda-generator-handler popularity was classified as not popular.
We found that lambda-generator-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.