Skip to content

update error message to mention repo & clean up some success/fail messages #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/code/PublishPSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ protected override void ProcessRecord()
return;
}

PushNupkg(outputNupkgDir, repositoryUrl);
PushNupkg(outputNupkgDir, repository.Name, repositoryUrl);
}
finally {
WriteVerbose(string.Format("Deleting temporary directory '{0}'", outputDir));
Expand Down Expand Up @@ -831,13 +831,13 @@ private bool PackNupkg(string outputDir, string outputNupkgDir, string nuspecFil
}
else
{
WriteVerbose("Successfully packed the resource into a .nupkg");
WriteVerbose("Not able to successfully pack the resource into a .nupkg");
}

return success;
}

private void PushNupkg(string outputNupkgDir, string repoUrl)
private void PushNupkg(string outputNupkgDir, string repoName, string repoUrl)
{
// Push the nupkg to the appropriate repository
// Pkg version is parsed from .ps1 file or .psd1 file
Expand Down Expand Up @@ -875,7 +875,7 @@ private void PushNupkg(string outputNupkgDir, string repoUrl)
// look in PS repo for how httpRequestExceptions are handled

// Unfortunately there is no response message are no status codes provided with the exception and no
var ex = new ArgumentException(e.Message);
var ex = new ArgumentException(String.Format("Repository '{0}': {1}", repoName, e.Message));
if (e.Message.Contains("401"))
{
if (e.Message.Contains("API"))
Expand Down Expand Up @@ -924,7 +924,7 @@ private void PushNupkg(string outputNupkgDir, string repoUrl)
}
else
{
WriteVerbose(string.Format("Successfully published the resource to '{0}'", repoUrl));
WriteVerbose(string.Format("Not able to publish resource to '{0}'", repoUrl));
}
}
}
Expand Down