Skip to content

Commit 89113a5

Browse files
committed
address comment: do not use enum
1 parent 90caa25 commit 89113a5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/telemetry/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/**
22
* Result type constants for telemetry events
33
*/
4-
export const TELEMETRY_RESULT = {
5-
SUCCESS: "success" as const,
6-
FAILURE: "failure" as const,
7-
};
8-
9-
export type TelemetryResult = (typeof TELEMETRY_RESULT)[keyof typeof TELEMETRY_RESULT];
4+
export type TelemetryResult = "success" | "failure";
105

116
/**
127
* Base interface for all events

src/tools/tool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ export abstract class ToolBase {
7474
);
7575

7676
const result = await this.execute(...args);
77-
await this.emitToolEvent(startTime, TELEMETRY_RESULT.SUCCESS);
77+
await this.emitToolEvent(startTime, "success");
7878
return result;
7979
} catch (error: unknown) {
8080
logger.error(mongoLogId(1_000_000), "tool", `Error executing ${this.name}: ${error as string}`);
8181

8282
await this.emitToolEvent(
8383
startTime,
84-
TELEMETRY_RESULT.FAILURE,
84+
"failure",
8585
error instanceof Error ? error : new Error(String(error))
8686
);
8787

0 commit comments

Comments
 (0)