Skip to content

fix: show error reason when installation fails#3855

Closed
Aditya-kumar-yadav wants to merge 5 commits into
spicetify:mainfrom
Aditya-kumar-yadav:main
Closed

fix: show error reason when installation fails#3855
Aditya-kumar-yadav wants to merge 5 commits into
spicetify:mainfrom
Aditya-kumar-yadav:main

Conversation

@Aditya-kumar-yadav
Copy link
Copy Markdown

@Aditya-kumar-yadav Aditya-kumar-yadav commented May 28, 2026

Fixes #3854

Installation scripts now print a specific error reason when a step
fails, instead of silently exiting.

Changes

  • install.sh: Added error handling for download, extraction, and chmod steps
  • install.ps1: Added try/catch blocks for download, extraction, and PATH update steps

Summary by CodeRabbit

  • Bug Fixes
    • Installer reliability improved: Windows and Unix/Linux installers now detect and report failures during download, extraction, permission and environment setup steps, provide clearer diagnostic hints, pause on error, and terminate with a failure status. Installation now also exits early on invalid version input or unmet prerequisites to avoid partial or broken installs.

Review Change Stack

Added error handling for download, extraction, and permission setting.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eaa1dc12-c2f3-4523-8abc-3435fd8293aa

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1906d and c3b051b.

📒 Files selected for processing (1)
  • install.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • install.ps1

📝 Walkthrough

Walkthrough

Both installation scripts now wrap download, extract, and configuration steps in explicit failure checks: PowerShell uses try/catch and exits with code 1 on errors; the shell script uses conditional checks that log targeted ERROR messages and exit with status 1.

Changes

Installation Error Handling Across Platforms

Layer / File(s) Summary
PowerShell download, PATH, extraction, and abort exits
install.ps1
Invoke-WebRequest, Expand-Archive, user PATH updates, and a user-provided version validation are wrapped in try/catch or use explicit exit 1; failures print an error indicator, warn with the caught exception ($_), pause, and exit 1.
Shell script download, extraction, and permission error handling
install.sh
curl download, tar extraction, and chmod are wrapped in if ! ...; then checks that log targeted ERROR messages (internet, archive corruption, or permissions hints) and exit 1 on failure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through scripts with nimble paws,
Wrapped downloads, tars, and PATH in laws.
When errors shout, they now explain—
No silent fails, no puzzling pain.
Hoppy logs for clearer gains!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding error reason display when installation fails, which directly addresses the primary objective.
Linked Issues check ✅ Passed The pull request successfully implements the requirement from #3854 by adding detailed error handling to both install.sh and install.ps1, providing specific error messages when installation steps fail.
Out of Scope Changes check ✅ Passed All changes are directly related to improving error reporting during installation; no out-of-scope modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.ps1`:
- Around line 108-109: The catch blocks in install.ps1 call plain "exit" (which
returns 0), so change each failing catch to return a non-zero code (e.g.,
replace "exit" with "exit 1" or "exit $LASTEXITCODE") so CI sees failures;
update the three catch clauses in install.ps1 accordingly (the catch blocks that
follow the install/initialization steps) to use a non-zero numeric exit value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 22a28646-c2ec-4d88-8d07-370eaf3bbb52

📥 Commits

Reviewing files that changed from the base of the PR and between a1447c8 and cd1013d.

📒 Files selected for processing (2)
  • install.ps1
  • install.sh

Comment thread install.ps1 Outdated
@rxri
Copy link
Copy Markdown
Member

rxri commented May 28, 2026

Does not fix the linked issue. Has nothing to do with download/extraction process

@rxri rxri closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spicetify does not tell the reason after installation failed

2 participants