summaryrefslogtreecommitdiff
path: root/packages/cli/src/utils/errors.ts
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-04-18 18:08:43 -0400
committerN. Taylor Mullen <[email protected]>2025-04-18 18:10:57 -0400
commit383b9177848eeefb8c123a7a7ecc0ee391380eea (patch)
tree4b1e06d5e74500ad81a61f9442581648063f86c0 /packages/cli/src/utils/errors.ts
parentfa264e42863474a809d06ef569f7ad5388d48072 (diff)
Run `npm run format`
- This has the entirety of the changes. Part of https://b.corp.google.com/issues/411720532
Diffstat (limited to 'packages/cli/src/utils/errors.ts')
-rw-r--r--packages/cli/src/utils/errors.ts28
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/cli/src/utils/errors.ts b/packages/cli/src/utils/errors.ts
index 7708895a..a7fcc5a3 100644
--- a/packages/cli/src/utils/errors.ts
+++ b/packages/cli/src/utils/errors.ts
@@ -1,18 +1,18 @@
export function isNodeError(error: unknown): error is NodeJS.ErrnoException {
- return error instanceof Error && 'code' in error;
+ return error instanceof Error && 'code' in error;
}
export function getErrorMessage(error: unknown): string {
- if (error instanceof Error) {
- return error.message;
- } else {
- // Attempt to convert the non-Error value to a string for logging
- try {
- const errorMessage = String(error);
- return errorMessage;
- } catch {
- // If String() itself fails (highly unlikely)
- return 'Failed to get error details';
- }
- }
-} \ No newline at end of file
+ if (error instanceof Error) {
+ return error.message;
+ } else {
+ // Attempt to convert the non-Error value to a string for logging
+ try {
+ const errorMessage = String(error);
+ return errorMessage;
+ } catch {
+ // If String() itself fails (highly unlikely)
+ return 'Failed to get error details';
+ }
+ }
+}