Skip to content

Commit 4720708

Browse files
committed
Report TypeError message in command telemetry
Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 90a772c commit 4720708

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vscommand.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ export async function registerCommands(...modules: string[]): Promise<Disposable
7070
// TODO: Wrap view title commands in try/catch and re-throw as VsCommandError
7171
// TODO: telemetry cannot send not known exception stacktrace or message
7272
// because it can contain user's sensitive information
73-
telemetryProps.error = 'Unexpected error';
73+
if (err instanceof TypeError) {
74+
telemetryProps.error = err.message;
75+
} else {
76+
telemetryProps.error = 'Unexpected error';
77+
}
7478
throw err;
7579
}
7680
} finally {

0 commit comments

Comments
 (0)