aura_baseview/init_error.rs
1use std::fmt;
2
3/// Soft-fail error when a renderer backend (OpenGL / wgpu) cannot start.
4/// Returned to the host instead of panicking.
5#[derive(Debug)]
6pub struct InitError {
7 pub message: String,
8}
9
10impl InitError {
11 pub fn new(message: impl Into<String>) -> Self {
12 Self {
13 message: message.into(),
14 }
15 }
16}
17
18impl fmt::Display for InitError {
19 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20 f.write_str(&self.message)
21 }
22}
23
24impl std::error::Error for InitError {}