Skip to content

Commit 97ec422

Browse files
authored
fix(cli/icon): return with an error instead of panic (#9638)
* fix(cli/icon): return with an error instead of panic closes #9636 * Update .changes/cli-icon-non-0-exit.md
1 parent 7f6d269 commit 97ec422

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changes/cli-icon-non-0-exit.md

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+
Exit `tauri icon` with non-zero code when it fails.

tooling/cli/src/icon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ pub fn command(options: Options) -> Result<()> {
138138
))
139139
}
140140
} else {
141-
panic!("Error loading image");
141+
anyhow::bail!("Error loading image");
142142
};
143143

144144
if source.height() != source.width() {
145-
panic!("Source image must be square");
145+
anyhow::bail!("Source image must be square");
146146
}
147147

148148
if png_icon_sizes.is_empty() {

0 commit comments

Comments
 (0)