feat: Add hardened error handling and retries (#2451)

- Closes #1830
 - Closes #2099
This commit is contained in:
Dermot Duffy
2026-06-30 17:45:12 -07:00
committed by dermotduffy
parent 4bc787e2b7
commit 47bcce93d3
182 changed files with 7877 additions and 4043 deletions
+3 -7
View File
@@ -14,7 +14,7 @@ import { customElement } from 'lit/decorators.js';
import { query } from 'lit/decorators/query.js';
import { dispatchLiveErrorEvent } from '../components-lib/live/utils/dispatch-live-error.js';
import { VideoMediaPlayerController } from '../components-lib/media-player/video.js';
import { renderMessage } from '../components/message.js';
import { renderNotificationBlockFromText } from '../components/notification/block.js';
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
import { MediaPlayer, MediaPlayerController } from '../types.js';
import { mayHaveAudio } from '../utils/audio.js';
@@ -60,12 +60,8 @@ customElements.whenDefined('ha-hls-player').then(() => {
if (this._error) {
if (this._errorIsFatal) {
dispatchLiveErrorEvent(this);
return renderMessage({
type: 'error',
message: this._error,
context: {
entity_id: this.entityid,
},
return renderNotificationBlockFromText(this._error, {
metadata: [{ text: this.entityid, icon: 'mdi:cctv' }],
});
} else {
errorToConsole(this._error, console.error);
+3 -7
View File
@@ -14,7 +14,7 @@ import { customElement } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { dispatchLiveErrorEvent } from '../components-lib/live/utils/dispatch-live-error.js';
import { VideoMediaPlayerController } from '../components-lib/media-player/video.js';
import { renderMessage } from '../components/message.js';
import { renderNotificationBlockFromText } from '../components/notification/block.js';
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
import { MediaPlayer, MediaPlayerController } from '../types.js';
import {
@@ -100,12 +100,8 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
protected render(): TemplateResult | void {
if (this._error) {
dispatchLiveErrorEvent(this);
return renderMessage({
type: 'error',
message: this._error,
context: {
entity_id: this.entityid,
},
return renderNotificationBlockFromText(this._error, {
metadata: [{ text: this.entityid, icon: 'mdi:cctv' }],
});
}
return html`