Use custom websocket to avoid needing admin privileges.

This commit is contained in:
Dermot Duffy
2024-08-24 20:00:00 -07:00
parent 5a1d08f3ea
commit 429dd90972
47 changed files with 1219 additions and 874 deletions
+5 -4
View File
@@ -42,16 +42,17 @@ export class MessageManager {
}
}
public setErrorIfHigherPriority(error: unknown): void {
public setErrorIfHigherPriority(error: unknown, prefix?: string): void {
// This object should accept unknown objects to be able to seamlessly
// process arguments to catch() which can only be unknown/any.
if (!(error instanceof Error)) {
// process arguments to catch() which can only be unknown/any. HA may throw
// non Error() based errors.
if (!error || typeof error !== 'object' || !('message' in error)) {
return;
}
errorToConsole(error);
this.setMessageIfHigherPriority({
message: error.message,
message: prefix ? `${prefix}: ${error.message}` : error.message,
type: 'error',
...(error instanceof FrigateCardError && { context: error.context }),
});