mirror of
https://github.com/tale/headplane.git
synced 2026-08-27 15:37:04 +00:00
fix: handle headscale unavailability gracefully
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user