Skip to content

docs: fix inverted description of $ErrorActionPreference = Stop in FAQ#27351

Open
lingxiu58 wants to merge 1 commit into
PowerShell:masterfrom
lingxiu58:fix-faq-error-handling
Open

docs: fix inverted description of $ErrorActionPreference = Stop in FAQ#27351
lingxiu58 wants to merge 1 commit into
PowerShell:masterfrom
lingxiu58:fix-faq-error-handling

Conversation

@lingxiu58
Copy link
Copy Markdown

Summary

Fixes an incorrect description in docs/FAQ.md in the "Why did an error not throw an exception?" section.

Problem

The current text reads:

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

This is inverted and confusing. The preference causes non-terminating errors to be treated as terminating (i.e. they throw catchable exceptions), not the other way around.

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 catchable exceptions).

Closes #27350

Signed-off-by: Cocoon-Break 86288566+lingxiu58@users.noreply.github.com

The FAQ entry for 'Why did an error not throw an exception?' said that
setting $ErrorActionPreference = 'Stop' causes 'non-terminating errors
instead of terminating', which is the opposite of what it actually does.

The preference causes non-terminating errors to be treated as terminating
(i.e. they throw catchable exceptions), not the other way around.

Closes PowerShell#27350

Signed-off-by: Cocoon-Break <86288566+lingxiu58@users.noreply.github.com>
@DavinciShah
Copy link
Copy Markdown

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants