egl: revise how we report egl init errors

This commit is contained in:
Wez Furlong committed 2020-07-13 08:02:19 -07:00
1 parent a9ee544d7c
commit 4cd4ee2eb5
1 file changed
+6 -3
+6 -3
View File
@@ -334,6 +334,9 @@ impl GlState {
#[cfg(not(target_os = "windows"))]
"libEGL.so",
];
let mut errors = vec![];
for path in &paths {
if let Ok(lib) = libloading::Library::new(path) {
match EglWrapper::load_egl(lib) {
@@ -343,16 +346,16 @@ impl GlState {
return Ok(result);
}
Err(e) => {
log::error!("with_egl_lib failed: {}", e);
errors.push(format!("with_egl_lib({}) failed: {}", path, e));
}
},
Err(e) => {
log::error!("load_egl failed: {}", e);
errors.push(format!("load_egl {} failed: {}", path, e));
}
}
}
}
bail!("EGL library not found")
bail!("with_egl_lib failed: {}", errors.join(", "))
}
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]