killeros 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { safeTerminalText } from "./safe-terminal-text.ts";
3
-
4
- /** Checks a caught value for one exact string error code. */
5
- export function hasErrorCode(error: unknown, code: string): boolean {
6
- return typeof error === "object"
7
- && error !== null
8
- && "code" in error
9
- && error.code === code;
10
- }
11
-
12
- /** Converts unknown caught values into text suitable for user-facing errors. */
13
- export function errorMessage(error: unknown): string {
14
- return safeTerminalText(error instanceof Error ? error.message : String(error));
15
- }
16
-
17
- export function reportError(ctx: ExtensionContext, area: string, error: unknown): void {
18
- ctx.ui.notify(`${area}: ${errorMessage(error)}`, "error");
19
- }
1
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
+ import { safeTerminalText } from "./safe-terminal-text.ts";
3
+
4
+ /** Checks a caught value for one exact string error code. */
5
+ export function hasErrorCode(error: unknown, code: string): boolean {
6
+ return typeof error === "object"
7
+ && error !== null
8
+ && "code" in error
9
+ && error.code === code;
10
+ }
11
+
12
+ /** Converts unknown caught values into text suitable for user-facing errors. */
13
+ export function errorMessage(error: unknown): string {
14
+ return safeTerminalText(error instanceof Error ? error.message : String(error));
15
+ }
16
+
17
+ export function reportError(ctx: ExtensionContext, area: string, error: unknown): void {
18
+ ctx.ui.notify(`${area}: ${errorMessage(error)}`, "error");
19
+ }