Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: if bootstrap failed, it could end with an empty screen instead of error #8856

Merged
merged 3 commits into from Mar 14, 2021

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Mar 13, 2021

Fixes #8855

Motivation / Problem

Bootstrap had a flow where it could leave the screen with no open window. This is rather confusing for any human. Show an error instead, with next steps.

Description

There are various of ways bootstrap can fail:
- Failing network connection
- Incomplete download
- No write permissions
- Disk full
- (others I forgot)

They all result in a screen with no windows. To ensure we at least
always show something when anything bad happens, if the bootstrap
is not successful, show a screen what the next step for the human
should be.

image

Limitations

This does not show the real error that happened. Some flows do have some snippets of information (like "write to file failed"), but most just close the download window. Additionally, showing real errors is rather difficult without hacking or rewriting the error window. Both felt a bit excessive for something that shouldn't happen in most cases.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

src/bootstrap_gui.cpp Outdated Show resolved Hide resolved
src/bootstrap_gui.cpp Outdated Show resolved Hide resolved
@TrueBrain TrueBrain changed the title Fix: if boostrap failed, it could end with an empty screen instead of error Fix: if bootstrap failed, it could end with an empty screen instead of error Mar 13, 2021
…f error

There are various of ways bootstrap can fail:
- Failing network connection
- Incomplete download
- No write permissions
- Disk full
- (others I forgot)

They all result in a screen with no windows. To ensure we at least
always show something when anything bad happens, if the bootstrap
is not successful, show a screen what the next step for the human
should be.
For example, if you have a config that defines OpenGFX as baseset
but for some reason you have no basesets anymore. In that case
bootstrap downloads OpenGFX for you, but it will still show the
error that "OpenGFX was not found" after the bootstrap. This was
an error generated before the bootstrapped kicked in.

Simply muting all errors during bootstrap solves this; as we cannot
show them anyway, this is fine. Any errors that remain after
bootstrap will be generated again anyway.
@TrueBrain TrueBrain merged commit c258477 into OpenTTD:master Mar 14, 2021
@TrueBrain TrueBrain deleted the bootstrap-failure branch March 14, 2021 10:04
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.

Black/red window on startup (macOS 10.15.7)
3 participants