Skip to content

Commit 6eedbbe

Browse files
committed
docs: small inline docs improvements
1 parent cc59160 commit 6eedbbe

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: packages/tracer/src/Tracer.ts

+4
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ class Tracer extends Utility implements TracerInterface {
373373
if (options?.captureError ?? true) {
374374
tracerRef.addErrorAsMetadata(error as Error);
375375
} else {
376+
// Though we aren't adding the error as metadata, we should still
377+
// mark the segment as having an error.
376378
tracerRef.getSegment().addErrorFlag();
377379
}
378380
throw error;
@@ -450,6 +452,8 @@ class Tracer extends Utility implements TracerInterface {
450452
if (options?.captureError ?? true) {
451453
tracerRef.addErrorAsMetadata(error as Error);
452454
} else {
455+
// Though we aren't adding the error as metadata, we should still
456+
// mark the segment as having an error.
453457
tracerRef.getSegment().addErrorFlag();
454458
}
455459

Diff for: packages/tracer/src/types/Tracer.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ type TracerOptions = {
3636
*
3737
* class MyThing {
3838
* @tracer.captureMethod({ captureResponse: false, captureError: false })
39-
* async myMethod() { ... }
39+
* myMethod(): string {
40+
* return 'foo bar';
41+
* }
4042
* }
4143
* ```
4244
*/
@@ -55,7 +57,7 @@ type TracerCaptureMethodOptions = {
5557
*
5658
* class MyThing implements LambdaInterface {
5759
* @tracer.captureLambdaHandler({ captureResponse: false, captureError: false })
58-
* async handler() { ... }
60+
* async handler(_event: any, _context: any): Promise<void> {}
5961
* }
6062
* ```
6163
*/

0 commit comments

Comments
 (0)