fix: handle headscale unavailability gracefully

This commit is contained in:
Aarnav Tale
2025-01-17 11:45:36 +00:00
parent e01fd8d50c
commit 1b45b0917f
9 changed files with 135 additions and 80 deletions
+2 -3
View File
@@ -8,7 +8,6 @@ interface Props {
type?: 'full' | 'embedded';
}
function getMessage(error: Error | unknown) {
if (!(error instanceof Error)) {
return "An unknown error occurred";
@@ -18,9 +17,9 @@ function getMessage(error: Error | unknown) {
// Traverse the error chain to find the root cause
if (error.cause) {
rootError = error.cause;
rootError = error.cause as Error;
while (rootError.cause) {
rootError = rootError.cause;
rootError = rootError.cause as Error;
}
}