Commit 4f51cce
Comprehensive accuracy overhaul: escalation semantics, asymmetry, parse errors
Major corrections verified against PowerShell engine source code:
- Fix: -ErrorAction Stop produces script-terminating errors, not
statement-terminating. ActionPreferenceStopException sets
SuppressPromptInInterpreter=true, causing call-stack unwinding.
Fixed across all 4 affected files.
- Add: New "$ErrorActionPreference asymmetry" section in
about_Error_Handling documenting that $ErrorActionPreference applies
to BOTH non-terminating and statement-terminating errors, while
-ErrorAction only affects non-terminating errors. Includes runnable
demo and IMPORTANT callout for exceptions (SuppressPromptInInterpreter,
PS classes, PipelineStoppedException).
- Add: Parse errors to script-terminating generators list (per
mklement0 review comment).
- Fix: about_Preference_Variables Ignore bullet incorrectly stated
"Ignore isn't a valid value for $ErrorActionPreference" — it is
accepted (only Suspend is rejected per ExecutionContext.cs).
- Fix: NOTE block on ThrowTerminatingError now correctly explains
that $ErrorActionPreference can suppress it via the engine's
statement-level handler in MiscOps.CheckActionPreference.
- Fix: Summary table updated — -ErrorAction Stop moved from
statement-terminating to script-terminating column, new row added
for $ErrorActionPreference behavior per error type.
- Fix: everything-about-exceptions.md — three remaining instances of
vague "terminating error" updated to "script-terminating error" for
throw and -ErrorAction Stop contexts.
All claims verified with live PowerShell 7.x tests:
1. -ErrorAction Stop: next statement in scriptblock does NOT run (script-terminating)
2. Parse errors: caught as MethodInvocationException
3. $ErrorActionPreference='Ignore': accepted without error
4. $ErrorActionPreference='SilentlyContinue': suppresses ThrowTerminatingError
5. -ErrorAction SilentlyContinue: does NOT suppress ThrowTerminatingError
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c662119 commit 4f51cce
File tree
4 files changed
+77
-22
lines changed- reference
- 7.6/Microsoft.PowerShell.Core/About
- docs-conceptual/learn/deep-dives
4 files changed
+77
-22
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
Lines changed: 64 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
207 | | - | |
| 212 | + | |
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
213 | 218 | | |
214 | | - | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
| |||
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
228 | | - | |
| 234 | + | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| |||
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
246 | 297 | | |
247 | 298 | | |
248 | 299 | | |
| |||
382 | 433 | | |
383 | 434 | | |
384 | 435 | | |
385 | | - | |
| 436 | + | |
386 | 437 | | |
387 | 438 | | |
388 | 439 | | |
389 | 440 | | |
390 | 441 | | |
391 | | - | |
| 442 | + | |
| 443 | + | |
392 | 444 | | |
393 | 445 | | |
394 | 446 | | |
| |||
409 | 461 | | |
410 | 462 | | |
411 | 463 | | |
| 464 | + | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
392 | | - | |
393 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| |||
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
0 commit comments