Repository: tauri-apps/tauri
File: crates/tauri-bundler/src/error.rs (Rust)

Code before:
  #[cfg(any(target_os = "macos", windows))]
  #[error("`{0}`")]
  RegexError(#[from] regex::Error),
  /// Failed to perform HTTP request.
  #[error("`{0}`")]
  HttpError(#[from] Box<ureq::Error>),
  /// Invalid glob pattern.
  #[cfg(windows)]
  #[error("{0}")]
  GlobPattern(#[from] glob::PatternError),
  /// Failed to use glob pattern.
  #[cfg(windows)]
  #[error("`{0}`")]
  Glob(#[from] glob::GlobError),
  /// Failed to parse the URL
  #[error("`{0}`")]
  UrlParse(#[from] url::ParseError),
  /// Failed to validate downloaded file hash.
  #[error("hash mismatch of downloaded file")]
  HashError,
  /// Failed to parse binary
  #[error("Binary parse error: `{0}`")]
  BinaryParseError(#[from] goblin::error::Error),
  /// Package type is not supported by target platform
  #[deprecated(note = "User WrongPackageType instead")]
  #[error("Wrong package type {0} for platform {1}")]
  InvalidPackageType(String, String),
  /// Package type is not supported by target platform
  #[error("Wrong package type {0}")]
  WrongPackageType(String),
  /// Bundle type symbol missing in binary
  #[error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date")]
  MissingBundleTypeVar,
  /// Failed to write binary file changed
  #[error("Failed to write binary file changes: `{0}`")]
  BinaryWriteError(String),
  /// Unsupported architecture.
  #[error("Architecture Error: `{0}`")]
  ArchError(String),
  /// Couldn't find icons.
  #[error("Could not find Icon paths.  Please make sure they exist in the tauri config JSON file")]
  IconPathError,
  /// Couldn't find background file.
  #[error("Could not find background file. Make sure it exists in the tauri config JSON file and extension is png/jpg/gif")]
  BackgroundPathError,
  /// Error on path util operation.
  #[error("Path Error:`{0}`")]
  PathUtilError(String),
  /// Error on shell script.
  #[error("Shell Scripting Error:`{0}`")]
  ShellScriptError(String),

Review comment (bug):
Any reason we change this to `WrongPackageType` and removed the platform info?

Code after:
  #[cfg(any(target_os = "macos", windows))]
  #[error("`{0}`")]
  RegexError(#[from] regex::Error),
  /// Failed to perform HTTP request.
  #[error("`{0}`")]
  HttpError(#[from] Box<ureq::Error>),
  /// Invalid glob pattern.
  #[cfg(windows)]
  #[error("{0}")]
  GlobPattern(#[from] glob::PatternError),
  /// Failed to use glob pattern.
  #[cfg(windows)]
  #[error("`{0}`")]
  Glob(#[from] glob::GlobError),
  /// Failed to parse the URL
  #[error("`{0}`")]
  UrlParse(#[from] url::ParseError),
  /// Failed to validate downloaded file hash.
  #[error("hash mismatch of downloaded file")]
  HashError,
  /// Failed to parse binary
  #[error("Binary parse error: `{0}`")]
  BinaryParseError(#[from] goblin::error::Error),
  /// Package type is not supported by target platform
  #[error("Wrong package type {0} for platform {1}")]
  InvalidPackageType(String, String),
  /// Bundle type symbol missing in binary
  #[error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date")]
  MissingBundleTypeVar,
  /// Failed to write binary file changed
  #[error("Failed to write binary file changes: `{0}`")]
  BinaryWriteError(String),
  /// Invalid offset while patching binary file
  #[deprecated]
  #[error("Invalid offset while patching binary file")]
  BinaryOffsetOutOfRange,
  /// Unsupported architecture.
  #[error("Architecture Error: `{0}`")]
  ArchError(String),
  /// Couldn't find icons.
  #[error("Could not find Icon paths.  Please make sure they exist in the tauri config JSON file")]
  IconPathError,
  /// Couldn't find background file.
  #[error("Could not find background file. Make sure it exists in the tauri config JSON file and extension is png/jpg/gif")]
  BackgroundPathError,
  /// Error on path util operation.
  #[error("Path Error:`{0}`")]
  PathUtilError(String),
  /// Error on shell script.
  #[error("Shell Scripting Error:`{0}`")]
  ShellScriptError(String),