Skip to content

Commit

Permalink
fix: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rfoel committed May 16, 2022
1 parent f95f02b commit e1e2930
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 103 deletions.
9 changes: 8 additions & 1 deletion handlers/cnpj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const close = async () => {
export const handler = async (
event: APIGatewayProxyEvent,
): Promise<APIGatewayProxyResult> => {
console.log('REQUEST', JSON.stringify(event, null, 2))

let data
let response

try {
await launch()
Expand Down Expand Up @@ -82,6 +85,10 @@ export const handler = async (
}
} catch (error) {
await close()
return { statusCode: 500, body: JSON.stringify(error) }
response = { statusCode: 500, body: JSON.stringify(error) }
}

console.log('RESPONSE', JSON.stringify(response, null, 2))

return response
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"@semantic-release/github": "^8.0.4",
"@semantic-release/npm": "^9.0.1",
"@semantic-release/release-notes-generator": "^10.0.3",
"@types/aws-lambda": "^8.10.95",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"@types/aws-lambda": "^8.10.97",
"@typescript-eslint/eslint-plugin": "^5.24.0",
"@typescript-eslint/parser": "^5.24.0",
"aws-lambda": "^1.0.7",
"eslint": "^8.14.0",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.6.2",
"semantic-release": "^19.0.2",
"serverless": "^3.16.0",
"serverless": "^3.17.0",
"serverless-domain-manager": "^6.0.3",
"serverless-plugin-typescript": "^2.1.2",
"typescript": "^4.6.4"
Expand Down
Loading

0 comments on commit e1e2930

Please sign in to comment.