mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-29 09:33:59 +01:00
start_failure: say the window could not start or stopped, and offer the driver as a likely fix
The dialog is shown for any error run_native returns, including one after the window was up, so "could not start its window" and "updating the graphics driver usually fixes this" overstated what is known. From review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9e3a9ea83
commit
6f73fc7c77
1 file changed
+4
-3
@@ -10,9 +10,10 @@
|
||||
//! Now the reason also goes to an error dialog, as FilmCraft does since 0.14.0. The dialog keeps
|
||||
//! the process alive until it is dismissed; the exit code afterwards is still the error's.
|
||||
|
||||
/// What the dialog and the log say.
|
||||
/// What the dialog and the log say. Any error `run_native` returns lands here, also one after the
|
||||
/// window was up, so graphics is only the likely cause, not the certain one.
|
||||
pub(crate) fn message(error: &eframe::Error) -> String {
|
||||
format!("MaterialCraft could not start its window: {error}\n\nUpdating the graphics driver usually fixes this.")
|
||||
format!("MaterialCraft's window could not start or stopped with an error: {error}\n\nIf this keeps happening, updating the graphics driver often fixes it.")
|
||||
}
|
||||
|
||||
/// Logs the failure and shows it in a dialog, which stays until the user closes it.
|
||||
@@ -29,7 +30,7 @@ mod tests {
|
||||
#[test]
|
||||
fn the_message_names_the_cause_and_what_to_do() {
|
||||
let text = message(&eframe::Error::AppCreation("no adapter".into()));
|
||||
assert!(text.starts_with("MaterialCraft could not start its window"), "{text}");
|
||||
assert!(text.starts_with("MaterialCraft's window could not start or stopped"), "{text}");
|
||||
assert!(text.contains("no adapter"), "{text}");
|
||||
assert!(text.contains("graphics driver"), "{text}");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user