Skip to content

docs/FAQ.md: Error handling description has reversed explanation of $ErrorActionPreference #27350

@lingxiu58

Description

@lingxiu58

Bug in docs/FAQ.md

Section: "Why did an error not throw an exception?"

Current text

Setting $ErrorActionPreference = 'Stop' will likely do what you want; that is, cause
non-terminating errors instead of terminating.

Problem

This is inverted. Setting $ErrorActionPreference = 'Stop' causes non-terminating errors to become terminating (they throw catchable exceptions). The current phrasing says it causes "non-terminating errors instead of terminating", which contradicts what it actually does and is confusing to readers.

Suggested fix

-Setting `$ErrorActionPreference = 'Stop'` will likely do what you want; that is, cause
-non-terminating errors instead of terminating.
+Setting `$ErrorActionPreference = 'Stop'` will likely do what you want; that is, cause
+non-terminating errors to be treated as terminating (throwing exceptions).

Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables#erroractionpreference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions