-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(logging): Adjusting webhook logs and levels (#1287)
* fix(logging): Adjusting webhook logs and levels * Correcting object key * Minor refactoring to support additional logging
- Loading branch information
Showing
2 changed files
with
41 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { handle } from './webhook/handler'; | ||
import { APIGatewayEvent, Context } from 'aws-lambda'; | ||
import { APIGatewayEvent, Context, Callback } from 'aws-lambda'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export const githubWebhook = async (event: APIGatewayEvent, context: Context, callback: any): Promise<void> => { | ||
export const githubWebhook = async (event: APIGatewayEvent, context: Context, callback: Callback): Promise<void> => { | ||
try { | ||
const statusCode = await handle(event.headers, event.body); | ||
const statusCode = await handle(event.headers, event.body as string); | ||
callback(null, { | ||
statusCode: statusCode, | ||
}); | ||
} catch (e) { | ||
callback(e); | ||
callback(e as Error); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters