Skip to content

"Exception thrown from prompt block" even when the exception is handled within the block #68

@Lockszmith-GH

Description

@Lockszmith-GH

Run the following to test this issue:

$Prompt.Add( { try{throw "error"}catch{} } )

The result is a WARNING:

WARNING: Exception thrown from prompt block. Check $PromptErrors. To suppress this message, Set-PowerLine -HideError
WARNING: Exception in PowerLinePrompt

$PromptErrors contains:

Name  : 3 { try{throw "error"}catch{} }
Value : {System.Management.Automation.RuntimeException}
  • PowerLine Module Version 3.4.0
  • Pansies Module Version 2.3.1
    Tested on:
  • Arch Linux with PowerShell Core 7.1.5
  • Windows 10 with PowerShell 5.1.19041.1237

Expected behavior:

  • When an exception is captured, the error should not be displayed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions