From 6c386acca03b00cb0c96ec864cdae834a19c4d5c Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 3 Nov 2021 17:07:01 -0400 Subject: [PATCH] update error message to mention repo name, also clean up some success/fail messages --- src/code/PublishPSResource.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/code/PublishPSResource.cs b/src/code/PublishPSResource.cs index 5d7c13176..bb74a005e 100644 --- a/src/code/PublishPSResource.cs +++ b/src/code/PublishPSResource.cs @@ -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)); @@ -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 @@ -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")) @@ -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)); } } }