From aebe4e22d794b663f57cb74047c57e08c60c4291 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 14:09:53 +0000 Subject: [PATCH] fix: say which requirement has no license when packaging stops packageToolbox adds each GitHub requirement to the toolbox as additional software with the URL of its license file. When GitHub finds no license for one of them, its /license endpoint returns 404 and packaging stopped with the raw webread error, which doesn't say what to do: The server returned the status 404 with message "Not Found" in response to the request to URL https://api.github.com/repos/VH-Lab/pyraview/license. getLicenseHtmlUrl now turns that 404 into a MatBox:GitHub:LicenseNotFound error naming the repository and asking for a LICENSE file. Packaging still stops, as it should: MATLAB needs a valid license URL for each additional software package, shown to the user during installation. Not run: MATLAB is not available where this was written. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01W156oKLRkXpxcrNEtFtyxH --- .../+setup/+internal/+github/+api/getLicenseHtmlUrl.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/+matbox/+setup/+internal/+github/+api/getLicenseHtmlUrl.m b/code/+matbox/+setup/+internal/+github/+api/getLicenseHtmlUrl.m index ea4219b..0e4acc9 100644 --- a/code/+matbox/+setup/+internal/+github/+api/getLicenseHtmlUrl.m +++ b/code/+matbox/+setup/+internal/+github/+api/getLicenseHtmlUrl.m @@ -14,6 +14,12 @@ catch ME if contains(ME.message, 'rate limit') error('GitHub API rate limit exceeded. Consider using a GITHUB_TOKEN environment variable.'); + elseif strcmp(ME.identifier, 'MATLAB:webservices:HTTP404StatusCodeError') + % GitHub returns 404 when it finds no license file in the repository + error('MatBox:GitHub:LicenseNotFound', ... + ['GitHub found no license for the repository "%s/%s". ', ... + 'Add a LICENSE file to that repository.'], ... + repositoryOwner, repositoryName) else rethrow(ME); end