Skip to content

Commit

Permalink
fix(cli/icon): return with an error instead of panic (#9638)
Browse files Browse the repository at this point in the history
* fix(cli/icon): return with an error instead of panic

closes #9636

* Update .changes/cli-icon-non-0-exit.md
  • Loading branch information
amrbashir authored May 2, 2024
1 parent 7f6d269 commit 97ec422
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/cli-icon-non-0-exit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-cli": "patch:bug"
"@tauri-apps/cli": "patch:bug"
---

Exit `tauri icon` with non-zero code when it fails.
4 changes: 2 additions & 2 deletions tooling/cli/src/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ pub fn command(options: Options) -> Result<()> {
))
}
} else {
panic!("Error loading image");
anyhow::bail!("Error loading image");
};

if source.height() != source.width() {
panic!("Source image must be square");
anyhow::bail!("Source image must be square");
}

if png_icon_sizes.is_empty() {
Expand Down

0 comments on commit 97ec422

Please sign in to comment.