Skip to content

Commit bde5fc8

Browse files
committed
Resolved issue with empty catch block
1 parent 7c29643 commit bde5fc8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

ModuleExplorer/functions/Show-ModuleCommandViewer.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,21 @@ function Show-ModuleCommandViewer {
467467
}
468468
([System.ConsoleKey]::RightArrow) {
469469
if ($helpOptions[$currentHelpOptionIndex] -eq "Online") {
470-
try { Get-Help $currentCommandObjectForHelp.CommandInfo -Online } catch {}
470+
try { Get-Help $currentCommandObjectForHelp.CommandInfo -Online
471+
} catch {
472+
$currentHelpContentLines = "[red]Could not retrieve online help[/]"
473+
}
471474
$rightPaneView = 'HelpOptions'
472475
$currentHelpContentLines = @(); $helpContentScrollOffset = 0
473476
}
474477
}
475478
([System.ConsoleKey]::Enter) {
476479
if ($helpOptions[$currentHelpOptionIndex] -eq "Online") {
477-
try { Get-Help $currentCommandObjectForHelp.CommandInfo -Online } catch {}
480+
try { Get-Help $currentCommandObjectForHelp.CommandInfo -Online
481+
}
482+
catch {
483+
$currentHelpContentLines = "[red]Could not retrieve online help[/]"
484+
}
478485
$rightPaneView = 'HelpOptions'
479486
$currentHelpContentLines = @(); $helpContentScrollOffset = 0
480487
}

0 commit comments

Comments
 (0)