Skip to content

Commit a2181f4

Browse files
committed
fix error message
1 parent 945cc4c commit a2181f4

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@
222222
.bottom-left-icons:hover .icon-link {
223223
border-radius: 12px 12px 0 12px;
224224
}
225+
226+
.error {
227+
padding-top: 10px;
228+
font-size: small;
229+
opacity: 0.6;
230+
}
225231
</style>
226232
</head>
227233

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ fn start_app() {
6464
loading_text.remove();
6565
}
6666
Err(e) => {
67-
loading_text
68-
.set_inner_html(&format!("<p> The app has crashed. Error: {e:#?} </p>"));
67+
use web_sys::js_sys::JsString;
68+
69+
loading_text.set_inner_html(&format!(
70+
"<div> Please enable WebGPU and hardware acceleration in your browser :) </div> <div class=\"error\"> Error: {} </div>",
71+
std::convert::Into::<JsString>::into(e.clone())
72+
));
6973
panic!("Failed to start eframe: {e:?}");
7074
}
7175
}

0 commit comments

Comments
 (0)