From 1ca2f9871e582db6d5357e93d62a5fcb8095ac75 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Mon, 13 Oct 2025 10:27:00 +0200 Subject: [PATCH] Improve logging of extension manifest parsing errors (#40082) Due to using anyhow here, we otherwise lose the relevant error and just surface a fairly useless error message. Intentionally not doing this for `extension.json` parsing since that is deprecated. Release Notes: - N/A --- crates/extension/src/extension_manifest.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/extension/src/extension_manifest.rs b/crates/extension/src/extension_manifest.rs index f5296198b06ffeeb83dd21be35d27be6b4387294..70c5a55c853f13ac35ad47d1a1d5c56fb93361e4 100644 --- a/crates/extension/src/extension_manifest.rs +++ b/crates/extension/src/extension_manifest.rs @@ -1,4 +1,4 @@ -use anyhow::{Context as _, Result, bail}; +use anyhow::{Context as _, Result, anyhow, bail}; use collections::{BTreeMap, HashMap}; use fs::Fs; use language::LanguageName; @@ -226,8 +226,9 @@ impl ExtensionManifest { .load(&extension_manifest_path) .await .with_context(|| format!("failed to load {extension_name} extension.toml"))?; - toml::from_str(&manifest_content) - .with_context(|| format!("invalid extension.toml for extension {extension_name}")) + toml::from_str(&manifest_content).map_err(|err| { + anyhow!("Invalid extension.toml for extension {extension_name}:\n{err}") + }) } } }