|
1 | | -import { RedactableError } from "../../pure/errors"; |
2 | | -import { telemetryListener } from "../../telemetry"; |
3 | | -import { NotificationLogger } from "../logging"; |
| 1 | +import { NotificationLogger } from "./notification-logger"; |
4 | 2 |
|
5 | | -interface ShowAndLogExceptionOptions extends ShowAndLogOptions { |
6 | | - /** Custom properties to include in the telemetry report. */ |
7 | | - extraTelemetryProperties?: { [key: string]: string }; |
8 | | -} |
9 | | - |
10 | | -interface ShowAndLogOptions { |
| 3 | +export interface ShowAndLogOptions { |
11 | 4 | /** |
12 | 5 | * An alternate message that is added to the log, but not displayed in the popup. |
13 | 6 | * This is useful for adding extra detail to the logs that would be too noisy for the popup. |
14 | 7 | */ |
15 | 8 | fullMessage?: string; |
16 | 9 | } |
17 | 10 |
|
18 | | -/** |
19 | | - * Show an error message, log it to the console, and emit redacted information as telemetry |
20 | | - * |
21 | | - * @param logger The logger that will receive the message. |
22 | | - * @param error The error to show. Only redacted information will be included in the telemetry. |
23 | | - * @param options See individual fields on `ShowAndLogExceptionOptions` type. |
24 | | - * |
25 | | - * @return A promise that resolves to the selected item or undefined when being dismissed. |
26 | | - */ |
27 | | -export async function showAndLogExceptionWithTelemetry( |
28 | | - logger: NotificationLogger, |
29 | | - error: RedactableError, |
30 | | - options: ShowAndLogExceptionOptions = {}, |
31 | | -): Promise<void> { |
32 | | - telemetryListener?.sendError(error, options.extraTelemetryProperties); |
33 | | - return showAndLogErrorMessage(logger, error.fullMessage, options); |
34 | | -} |
35 | | - |
36 | 11 | /** |
37 | 12 | * Show an error message and log it to the console |
38 | 13 | * |
|
0 commit comments