mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
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:
commit
3ffbd56c65
1 changed files with 10 additions and 3 deletions
|
@ -55,7 +55,10 @@ fn main() {
|
|||
init_logger(&logs_dir_path);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -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
|
||||
.spawn({
|
||||
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();
|
||||
|
||||
let app_version = ZED_APP_VERSION.map_or("dev".to_string(), |v| v.to_string());
|
||||
let is_pty = stdout_is_a_pty();
|
||||
panic::set_hook(Box::new(move |info| {
|
||||
let backtrace = Backtrace::new();
|
||||
|
|
Loading…
Reference in a new issue