The mermaid renderer can fail to render certain diagrams, and we already have a fallback for that. It's not worth crashing Zed over it. Wrapping `catch_unwind` alone doesn't work because our panic hooks terminate the process before unwinding begins (we intentionally terminate so the crash handler subprocess can generate a minidump), so there was no way to gracefully handle panics from third-party code until now (in rare cases where we need it, like in this case). To handle this gracefully, we added `crashes::recoverable_panic` which tells the panic hook to stand down on the current thread so the unwind can proceed and be caught. This should be used sparingly since caught panics bypass crash reporting. Release Notes: - Fixed a crash when rendering mermaid diagrams in markdown preview.
36 lines
707 B
TOML
36 lines
707 B
TOML
[package]
|
|
name = "crashes"
|
|
version = "0.1.0"
|
|
publish.workspace = true
|
|
edition.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
bincode.workspace = true
|
|
cfg-if.workspace = true
|
|
crash-handler.workspace = true
|
|
futures.workspace = true
|
|
log.workspace = true
|
|
minidumper.workspace = true
|
|
|
|
paths.workspace = true
|
|
release_channel.workspace = true
|
|
smol.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
system_specs.workspace = true
|
|
zstd.workspace = true
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
mach2.workspace = true
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
windows.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/crashes.rs"
|