Skip to content

Commit 018c530

Browse files
authored
Add class documentation FunctionSegmentNotDefinedErrorunexpected and make end_time optional (#845)
1 parent f44306d commit 018c530

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/tracing/tests/helpers/FunctionSegmentNotDefinedError.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* Thrown when the function segement (AWS::Lambda::Function) is not found in a trace.
3+
*
4+
* X-Ray segments are process asynchronously. They may not be available even after
5+
* the trace has already appeared. In that case, the function segment may be missing.
6+
* We will throw this error to notify caller.
7+
*/
18
export class FunctionSegmentNotDefinedError extends Error {
29
public constructor(msg: string) {
310
super(msg);

packages/tracing/tests/helpers/tracesUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ParsedDocument {
1919
name: string
2020
id: string
2121
start_time: number
22-
end_time: number
22+
end_time?: number
2323
// This flag may be set if the segment hasn't been fully processed
2424
// The trace may have already appeared in the `getTraceSummaries` response
2525
// but a segment may still be in_progress

0 commit comments

Comments
 (0)