Skip to content

Commit 2d389f9

Browse files
committed
populate out ErrorRecord in additional places
1 parent e7c0cb7 commit 2d389f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/code/PublishHelper.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,11 +1286,11 @@ private string CopyNupkgFileToTempPath(string nupkgFilePath, out ErrorRecord err
12861286
}
12871287
catch (Exception e)
12881288
{
1289-
_cmdletPassedIn.WriteError(new ErrorRecord(
1289+
errRecord = new ErrorRecord(
12901290
new ArgumentException($"Error moving .nupkg at -NupkgPath to temp nupkg dir path '{outputNupkgDir}' due to: '{e.Message}'."),
12911291
"ErrorMovingNupkg",
12921292
ErrorCategory.NotSpecified,
1293-
this));
1293+
this);
12941294

12951295
// exit process record
12961296
return destinationFilePath;
@@ -1330,6 +1330,12 @@ private void GetPackageInfoFromNupkg(string nupkgFilePath, out ErrorRecord errRe
13301330

13311331
if (!NuGetVersion.TryParse(version, out NuGetVersion nugetVersion))
13321332
{
1333+
errRecord = new ErrorRecord(
1334+
new ArgumentException($"Error parsing version '{version}' into NuGetVersion instance."),
1335+
"ErrorParsingNuGetVersion",
1336+
ErrorCategory.NotSpecified,
1337+
this);
1338+
13331339
return;
13341340
}
13351341

0 commit comments

Comments
 (0)