Skip to content

frontend: Localize startup failures with typed errors - #13872

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

frontend: Localize startup failures with typed errors#13872
rwinkelman wants to merge 1 commit into
obsproject:masterfrom
rwinkelman:fix/init-exception-localization-13394

Conversation

@rwinkelman

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 needs maintainer workflow approval for first-time contributors.

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.

AppInit and GetLocaleNames threw bare C strings, so the catch site
could only show an untranslated English message. Add OBSInitException
with an error code, map each code to Init.Error.* via QTStr, and keep
the developer detail string for the log line.

Other const-char throws (outputs/modules) are unchanged for now.

Fixes obsproject#13394
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

2 participants