Skip to content

Commit bef22e5

Browse files
committed
feat: #1 enable breadcrumb scoping
1 parent c1beb56 commit bef22e5

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

lib/raygun.aws.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Client } from "raygun";
22
import { Context, Handler } from "aws-lambda";
3-
4-
// TODO: Uncomment when raygun4node 1.1.0 is released
5-
// import { runWithBreadcrumbsAsync } from "raygun/build/raygun.breadcrumbs";
3+
import { runWithBreadcrumbsAsync } from "raygun/build/raygun.breadcrumbs";
64

75
export type AwsHandlerConfig = {
86
client: Client;
@@ -60,7 +58,7 @@ async function runHandler<TEvent, TResult>(
6058

6159
if (e instanceof Error) {
6260
await awsHandlerConfig.client.send(e, sendParams);
63-
} else if(typeof e === "string") {
61+
} else if (typeof e === "string") {
6462
// Wrap string exceptions in Error
6563
await awsHandlerConfig.client.send(Error(e), sendParams);
6664
} else {
@@ -87,9 +85,8 @@ export function awsHandler<TEvent, TResult>(
8785

8886
return async (event: TEvent, context: Context) => {
8987
// Scope breadcrumbs to this handler event
90-
// TODO: Uncomment when raygun4node 1.1.0 is released
91-
// return runWithBreadcrumbsAsync(() => {
92-
return runHandler(awsHandlerConfig, event, context, asyncHandler);
93-
// });
88+
return runWithBreadcrumbsAsync(() => {
89+
return runHandler(awsHandlerConfig, event, context, asyncHandler);
90+
});
9491
};
9592
}

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@types/aws-lambda": "^8.10.138",
33-
"raygun": "^1.0.0"
33+
"raygun": "^1.1.0"
3434
},
3535
"repository": {
3636
"type": "git",

0 commit comments

Comments
 (0)