diff options
| author | Luke Hoersten <[email protected]> | 2026-06-21 11:33:00 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-06-21 11:33:00 -0500 |
| commit | 44c7a636231d5fcde87187164cfc0b51d66f5898 (patch) | |
| tree | d2af10aaef8f1eefc8aa4c36b5dccce7f0d12a13 /scrypted | |
| parent | e9ef2f9f09c56e26a728b65cec9f5a260caeb5cd (diff) | |
scrypted: log end-of-method state for lifecycle calls + bootstrap exception
start() previously logged only at entry, so a silent throw between
'Scrypted Viewport up' and 'this.running = true' would leave us
guessing. Add explicit end-of-method logs with the post-write state,
plus a try/catch around bootstrap that surfaces the exception
message before re-throwing.
This will tell us whether start() reaches its set this.running=true
on script load (i.e. whether the prototype state-proxy write fires)
or whether bootstrap is silently failing somewhere mid-way.
Diffstat (limited to 'scrypted')
| -rw-r--r-- | scrypted/scrypted-viewport.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scrypted/scrypted-viewport.ts b/scrypted/scrypted-viewport.ts index 8df6371..861e665 100644 --- a/scrypted/scrypted-viewport.ts +++ b/scrypted/scrypted-viewport.ts @@ -424,15 +424,21 @@ class ScryptedViewportProvider extends ScryptedDeviceBase // we can drop the other (and the logging). async start() { - this.console.log(`lifecycle: start() called (running=${this.running})`); + this.console.log(`lifecycle: start() called (running=${this.running}, on=${this.on})`); if (this.running) return; - await this.bootstrap(); + try { + await this.bootstrap(); + } catch (e) { + this.console.error(`lifecycle: bootstrap threw:`, (e as Error).message); + throw e; + } this.running = true; this.on = true; + this.console.log(`lifecycle: start() complete — running=${this.running}, on=${this.on}, nativeId=${this.nativeId}`); } async stop() { - this.console.log(`lifecycle: stop() called (running=${this.running})`); + this.console.log(`lifecycle: stop() called (running=${this.running}, on=${this.on})`); if (!this.running) return; drainShutdownCleaners(this.console, "stop"); this.viewports.clear(); @@ -440,6 +446,7 @@ class ScryptedViewportProvider extends ScryptedDeviceBase this.streams.clear(); this.running = false; this.on = false; + this.console.log(`lifecycle: stop() complete — running=${this.running}, on=${this.on}`); } async turnOn() { |
