{"id":19274085,"url":"https://github.com/sbstjn/lambda-error","last_synced_at":"2026-04-16T15:32:10.098Z","repository":{"id":137671203,"uuid":"64840251","full_name":"sbstjn/lambda-error","owner":"sbstjn","description":"Node.js error object for streamlined errors using AWS Lambda and API Gateway","archived":false,"fork":false,"pushed_at":"2017-03-09T10:17:42.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T02:42:56.911Z","etag":null,"topics":["api-gateway","aws","aws-lambda","lambda-error"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstjn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-03T11:15:31.000Z","updated_at":"2021-08-10T00:42:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecdffaf6-699d-4cc3-b101-75eb1eec0a21","html_url":"https://github.com/sbstjn/lambda-error","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sbstjn/lambda-error","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Flambda-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Flambda-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Flambda-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Flambda-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstjn","download_url":"https://codeload.github.com/sbstjn/lambda-error/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Flambda-error/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31892154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","aws","aws-lambda","lambda-error"],"created_at":"2024-11-09T20:45:01.128Z","updated_at":"2026-04-16T15:32:10.075Z","avatar_url":"https://github.com/sbstjn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Lambda Error\n\n[![Travis](https://img.shields.io/travis/sbstjn/lambda-error.svg?maxAge=600)](https://travis-ci.org/sbstjn/latenz) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](https://github.com/sbstjn/lambda-error/commits/master) [![npm](https://img.shields.io/npm/dt/lambda-error.svg?maxAge=600)](https://www.npmjs.com/package/lambda-error) [![npm](https://img.shields.io/npm/v/lambda-error.svg?maxAge=600)](https://www.npmjs.com/package/lambda-error) [![Codecov](https://img.shields.io/codecov/c/github/sbstjn/lambda-error.svg?maxAge=600)](https://codecov.io/gh/sbstjn/lambda-error)\n\nIf you plan to use Node.js in an AWS Lambda function with an AWS API Gateway and need to have streamlined error objects for easy response parsing, just use `lambda-error`:\n\n```js\nvar lambdaErr = require('lambda-error');\n\nexports.handle = function(e, ctx, callback) {\n  if (!e.name) {\n    return callback(\n      lambdaErr.BadRequest('Missing name').toString()\n    );\n  }\n  \n  ctx.succeed({name: e.name, found: true});\n};\n```\n\n```js\nvar lambdaErr = require('lambda-error');\n\nexports.handle = function(e, ctx, callback) {\n  if (!e.name) {\n    return callback(\n      lambdaErr.BadRequest('Missing name').withContext(ctx).toString()\n    );\n  }\n  \n  ctx.succeed({name: e.name, found: true});\n};\n```\n\n### Available error codes\n\n - `BadRequest` (400)\n - `Forbidden` (403)\n - `NotFound` (404)\n - `Conflict` (409)\n - `InternalServerError` (500)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Flambda-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstjn%2Flambda-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Flambda-error/lists"}