Skip to content

Commit 272842a

Browse files
authored
fix(cli): interpolate format arguments in bail! literal messages (#16128)
1 parent aa0a801 commit 272842a

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Fix error messages that printed placeholders such as `{t}` literally instead of the value, e.g. "Could not find an Android device matching {t}".

‎crates/tauri-cli/src/build.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ pub fn setup(
171171

172172
if config.identifier == "com.tauri.dev" {
173173
crate::error::bail!(
174-
"You must change the bundle identifier in `{bundle_identifier_source} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.",
174+
"You must change the bundle identifier in `{} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.",
175+
bundle_identifier_source.to_string_lossy()
175176
);
176177
}
177178

‎crates/tauri-cli/src/error.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<T> ErrorExt<T> for std::result::Result<T, std::io::Error> {
9292

9393
macro_rules! bail {
9494
($msg:literal $(,)?) => {
95-
return Err(crate::Error::GenericError($msg.into()))
95+
return Err(crate::Error::GenericError(format!($msg)))
9696
};
9797
($err:expr $(,)?) => {
9898
return Err(crate::Error::GenericError($err))

0 commit comments

Comments
 (0)