Skip to content

Commit 1e6eda9

Browse files
author
James Brundage
committed
PipeScript Templates - Improving Error Behavior (Fixes #489)
1 parent 12ffae0 commit 1e6eda9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Transpilers/Core/PipeScript.Template.psx.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,15 @@ $replacePattern
557557

558558
# Now, we run the replacer.
559559
# This should run each inline script and replace the text.
560-
return $ReplacePattern.Replace($fileText, $ReplacementEvaluator)
560+
$replacement =
561+
try {
562+
$ReplacePattern.Replace($fileText, $ReplacementEvaluator)
563+
} catch {
564+
$ex = $_
565+
Write-Error -ErrorRecord $ex
566+
# $PSCmdlet.WriteError($ex)
567+
}
568+
return $replacement
561569
}
562570
}
563571

0 commit comments

Comments
 (0)