Render error message (not pointer) (#28797)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-04-15 22:27:09 -06:00 committed by GitHub
parent aceecec6bf
commit 6267a147ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,6 +27,8 @@ use objc::{
};
use std::{cell::RefCell, ffi::c_void, mem, ptr, rc::Rc};
use super::NSStringExt;
#[derive(Clone)]
pub struct MacScreenCaptureSource {
sc_display: id,
@ -184,7 +186,10 @@ pub(crate) fn get_sources() -> oneshot::Receiver<Result<Vec<Box<dyn ScreenCaptur
Ok(result)
} else {
let msg: id = msg_send![error, localizedDescription];
Err(anyhow!("Failed to register: {:?}", msg))
Err(anyhow!(
"Screen share failed: {:?}",
NSStringExt::to_str(&msg)
))
};
tx.send(result).ok();
});