From 76807b911f3912bf7ece03ff6d8370782d5c6fde Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 14 Dec 2024 22:46:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20error=20handlin?= =?UTF-8?q?g=20to=20script=20block=20execution=20in=20`LogGroup`=20(#205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Add error handling to script block execution in `LogGroup`. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- src/functions/public/Commands/Set-GitHubLogGroup.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/functions/public/Commands/Set-GitHubLogGroup.ps1 b/src/functions/public/Commands/Set-GitHubLogGroup.ps1 index 1aaaa5fb..a3516a76 100644 --- a/src/functions/public/Commands/Set-GitHubLogGroup.ps1 +++ b/src/functions/public/Commands/Set-GitHubLogGroup.ps1 @@ -41,6 +41,10 @@ ) Start-GitHubLogGroup -Name $Name - . $ScriptBlock + try { + . $ScriptBlock + } catch { + throw $_ + } Stop-GitHubLogGroup }