Skip to content

frontend: Localize startup failures with typed errors - #13871

Closed
rwinkelman wants to merge 2 commits into
obsproject:masterfrom
rwinkelman:fix/init-exception-localization-13394
Closed

frontend: Localize startup failures with typed errors#13871
rwinkelman wants to merge 2 commits into
obsproject:masterfrom
rwinkelman:fix/init-exception-localization-13394

Conversation

@rwinkelman

@rwinkelman rwinkelman commented Sep 4, 2026

Copy link
Copy Markdown

Description

Startup failures from OBSApp::AppInit and GetLocaleNames were thrown as bare const char * strings. The catch site in obs-main.cpp could only surface that English text, so users on other locales saw an untranslated error dialog.

This adds OBSInitException with an OBSInitErrorCode, keeps a short developer detail string for logging, and maps each code to a new Init.Error.* string in en-US.ini via QTStr for the dialog. Other const char * throws (outputs/modules) are left alone for a later change; the old catch remains as a fallback.

Motivation and Context

Fixes #13394. Matches the typed-error approach discussed on that issue.

How Has This Been Tested?

Built the changed frontend sources locally with the project clang-format config applied. Full OBS CI was pending first-time contributor workflow approval on the earlier push; please re-run after reopen.

Manual check still needed: normal launch, and a forced AppInit failure path to confirm the dialog uses Init.Error.* and the log line includes the error code name.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the Contributing Guidelines.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

…oject#13394)

Replace bare const char* throws in AppInit/GetLocaleNames with
OBSInitException carrying an InitErrorCode, log the code + developer
detail, and show a localized Init.Error.* message via OBSErrorBox.
@rwinkelman

Copy link
Copy Markdown
Author

CI is waiting on first-time contributor workflow approval (action_required). Once Approve and run workflows is clicked I can fix anything that fails. Taking #13394 as discussed on the issue (typed init exception + localized dialog).

@Fenrirthviti

Copy link
Copy Markdown
Member

This does not follow our PR template/contribution guidelines, and smells like AI.

@Warchamp7 Warchamp7 closed this Sep 4, 2026
@rwinkelman

Copy link
Copy Markdown
Author

Sorry about the earlier description — I missed the project PR template. Reopened with the template filled out, commits squashed to a single frontend: commit, and clang-format applied. Happy to adjust the design if you'd rather keep init throws as plain strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate string-based exceptions during initialization to localized error codes/types

3 participants