Surface error for missing key or url. - #6179
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved startup error handling can misclassify failures and provide incorrect recovery guidance.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds specific errors for missing stream keys or server URLs during stream startup.
Changes:
- Detects missing settings across stream output contexts.
- Adds typed errors and English translations.
- Surfaces more actionable startup diagnostics.
Review notes include unresolved context propagation, incorrect fallback classification for cancellations and non-streaming failures, and ineffective guidance for manual stream settings.
File summaries
| File | Summary |
|---|---|
app/services/streaming/streaming.ts |
Detects and surfaces missing stream settings. |
app/services/streaming/stream-error.ts |
Defines missing-setting error types and guidance. |
app/i18n/en-US/streaming.json |
Adds English error translations. |
Review details
Suppressed comments (7)
app/services/streaming/stream-error.ts:47
getMissingStreamSettingreachesSTREAM_SERVER_MISSINGonly whenstreamType !== 'rtmp_common', i.e. for a custom/manual ingest. Re-login or remerging cannot populate a manually configured server URL, so this directs users to an ineffective remedy; use a stream-settings instruction or choose the action based on the stream type.
STREAM_SERVER_MISSING: {
get message() {
return $t('Server url missing. Relogin or remerge to refresh it.');
},
app/services/streaming/stream-error.ts:42
- This type is also selected for
rtmp_customoutputs, where the key is manually configured rather than refreshed by logging in or remerging. In that case the message sends the user down the wrong recovery path; tailor the action to the stream type or instruct them to edit Stream Settings.
STREAM_KEY_MISSING: {
get message() {
return $t('Stream key missing. Relogin or remerge to refresh it.');
},
app/services/streaming/streaming.ts:4473
- This handler is shared by streaming, recording, and replay-buffer outputs, and
BadPathis also the error used for invalid recording paths. If a recording path fails while the stream key is empty, this condition selectsSTREAM_KEY_MISSINGand the recording error is reported as a stream-key problem, masking the actual path error. Restrict the missing-setting lookup to streaming outputs.
const missingSetting =
info.code === EOutputCode.InvalidStream || info.code === EOutputCode.BadPath
? this.getMissingStreamSetting(info.service)
: null;
app/services/streaming/streaming.ts:4426
- These values are read from the mutable global OBS settings, not from the settings used by the failing output instance. In the enhanced-broadcasting multistream path, Twitch settings are written,
createStreamingstarts the instance, and the previous custom settings are restored immediately afterward (lines 2619-2645). The later OBS error signal can therefore be checked against the restored settings and miss a missing Twitch key or report the wrong field. Keep the effective key/server/type with each output context or pass those values into this check.
const settings =
display === 'vertical'
? this.settingsService.views.values.StreamSecond
: this.settingsService.views.values.Stream;
app/services/streaming/streaming.ts:788
finishStartStreamingalso rejects with no error when the user cancels the confirmation dialog (lines 1956-1957). With this lookup, cancelling a start while the saved key is blank is treated asSTREAM_KEY_MISSINGand updates the stream error state even though no output was attempted. Only apply the missing-setting fallback after an actual output-start failure, while preserving the cancellation path.
const missingSetting = this.getMissingStreamSetting();
app/services/streaming/streaming.ts:795
finishStartStreaming()rejects for any output-start failure, not only stream-output failures (handleFactoryOutputErrorcallsrejectStartStreaming()for recording/replay-buffer and other errors too). This branch classifies all of those failures as a missing key/server whenever the current settings are blank, so an unrelated disk/path/encoder failure can be reported asSTREAM_KEY_MISSING. Carry the failing output type/context through the rejection and only apply this fallback to a confirmed streaming-output error.
} else if (missingSetting) {
failureType = missingSetting === 'key' ? 'STREAM_KEY_MISSING' : 'STREAM_SERVER_MISSING';
}
app/services/streaming/streaming.ts:4408
- The new documentation has a subject–verb agreement error: “signals” is plural, so this should say “OBS signals return …”.
* @remark OBS signals returns a generic `InvalidStream`/`BadPath` error when the stream failed to
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| : 'UNKNOWN_ERROR'; | ||
| // A blank stream key or server url fails here as a bare `UNKNOWN_ERROR`, which tells the | ||
| // user nothing. Name the missing field instead when that is what went wrong. | ||
| const missingSetting = this.getMissingStreamSetting(); |
BundleMonFiles updated (1)
Unchanged files (3)
Total files change +1.38KB +0.01% Final result: ✅ View report in BundleMon website ➡️ |
Surface a Specific Error When the Stream Key or Server URL Is Missing
Issues
Two separate paths in
streaming.tscollapse a missing stream key or server URL into an unhelpful generic error, giving the user no indication of what's actually wrong or how to fix it.Fixes
getMissingStreamSetting(context?)toStreamingService, which checksStreamorStreamSecondfor missing key(s)/url(s).STREAM_KEY_MISSINGandSTREAM_SERVER_MISSING.Files changed:
app/services/streaming/streaming.ts,app/services/streaming/stream-error.ts,app/i18n/en US/streaming.jsonPerformance Implications
None.