fix: handle headscale unavailability gracefully
This commit is contained in:
parent
e01fd8d50c
commit
1b45b0917f
9 changed files with 135 additions and 80 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue