diff --git a/CHANGELOG.md b/CHANGELOG.md index bf8ec0b3a5..6012fc2dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - **scoop-reset:** Don't abort when multiple apps are passed and an app is running ([#5687](https://github.com/ScoopInstaller/Scoop/issues/5687)) - **core:** Do not call `scoop` externally from inside the code ([#5695](https://github.com/ScoopInstaller/Scoop/issues/5695)) - **scoop-checkup:** Don't throw 7zip error when external 7zip is used ([#5703](https://github.com/ScoopInstaller/Scoop/issues/5703)) +- **config:** Warn users about misconfigured GitHub token ([#5777](https://github.com/ScoopInstaller/Scoop/issues/5777)) ### Performance Improvements diff --git a/lib/install.ps1 b/lib/install.ps1 index 519c26403d..60f6d5a649 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -107,6 +107,9 @@ function Start-Download ($url, $to, $cookies) { Invoke-Download $url $to $cookies $progress } catch { $e = $_.exception + if ($e.Response.StatusCode -eq 'Unauthorized') { + warn "Token might be misconfigured." + } if($e.innerexception) { $e = $e.innerexception } throw $e } @@ -246,7 +249,14 @@ function Invoke-CachedAria2Download ($app, $version, $manifest, $architecture, $ } else { $download_finished = $false # create aria2 input file content - $urlstxt_content += "$(handle_special_urls $url)`n" + try { + $try_url = handle_special_urls $url + } catch { + if ($_.Exception.Response.StatusCode -eq 'Unauthorized') { + warn "Token might be misconfigured." + } + } + $urlstxt_content += "$try_url`n" if (!$url.Contains('sourceforge.net')) { $urlstxt_content += " referer=$(strip_filename $url)`n" }