Merge pull request #1093 from zed-industries/fix-panic-version
Report the correct app version when sending panics to server
This commit is contained in:
+10
-3
@@ -55,7 +55,10 @@ fn main() {
|
|||||||
init_logger(&logs_dir_path);
|
init_logger(&logs_dir_path);
|
||||||
|
|
||||||
let mut app = gpui::App::new(Assets).unwrap();
|
let mut app = gpui::App::new(Assets).unwrap();
|
||||||
init_panic_hook(logs_dir_path, http.clone(), app.background());
|
let app_version = ZED_APP_VERSION
|
||||||
|
.or_else(|| app.platform().app_version().ok())
|
||||||
|
.map_or("dev".to_string(), |v| v.to_string());
|
||||||
|
init_panic_hook(logs_dir_path, app_version, http.clone(), app.background());
|
||||||
|
|
||||||
load_embedded_fonts(&app);
|
load_embedded_fonts(&app);
|
||||||
|
|
||||||
@@ -258,7 +261,12 @@ fn init_logger(logs_dir_path: &Path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_panic_hook(logs_dir_path: PathBuf, http: Arc<dyn HttpClient>, background: Arc<Background>) {
|
fn init_panic_hook(
|
||||||
|
logs_dir_path: PathBuf,
|
||||||
|
app_version: String,
|
||||||
|
http: Arc<dyn HttpClient>,
|
||||||
|
background: Arc<Background>,
|
||||||
|
) {
|
||||||
background
|
background
|
||||||
.spawn({
|
.spawn({
|
||||||
let logs_dir_path = logs_dir_path.clone();
|
let logs_dir_path = logs_dir_path.clone();
|
||||||
@@ -321,7 +329,6 @@ fn init_panic_hook(logs_dir_path: PathBuf, http: Arc<dyn HttpClient>, background
|
|||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
let app_version = ZED_APP_VERSION.map_or("dev".to_string(), |v| v.to_string());
|
|
||||||
let is_pty = stdout_is_a_pty();
|
let is_pty = stdout_is_a_pty();
|
||||||
panic::set_hook(Box::new(move |info| {
|
panic::set_hook(Box::new(move |info| {
|
||||||
let backtrace = Backtrace::new();
|
let backtrace = Backtrace::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user