Skip to content

Commit 7f6d269

Browse files
fix(core): better error when deserializing plugin config (#9631)
* Better error for errors decoding plugin config * changes
1 parent 8a71858 commit 7f6d269

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': patch:enhance
3+
---
4+
5+
Improve the error message that is shown when deserializing the Tauri plugin config.

core/tauri/src/plugin.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,12 @@ impl<R: Runtime, C: DeserializeOwned> Plugin<R> for TauriPlugin<R, C> {
677677
name: self.name,
678678
handle: app.clone(),
679679
raw_config: Arc::new(config.clone()),
680-
config: serde_json::from_value(config)?,
680+
config: serde_json::from_value(config).map_err(|err| {
681+
format!(
682+
"Error deserializing 'plugins.{}' within your Tauri configuration: {err}",
683+
self.name
684+
)
685+
})?,
681686
},
682687
)?;
683688
}

0 commit comments

Comments
 (0)