Skip to content

Commit 72cf39b

Browse files
committed
Remove [System.Exception] from try snippets.
After long discussion on PSMVP alias it seems that there's a bug with catch [System.Exception]. If there are two catch statements and the "general" case uses "catch [System.Exception" instead of "catch" the general case will run instead of the more specific exception!! That's pretty mind blowing. Fix PowerShell#296
1 parent 308b1bb commit 72cf39b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snippets/PowerShell.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@
729729
"try {",
730730
"\t$0",
731731
"}",
732-
"catch [${exception:System.Exception}] {",
732+
"catch {",
733733
"\t",
734734
"}"
735735
],
@@ -741,7 +741,7 @@
741741
"try {",
742742
"\t$0",
743743
"}",
744-
"catch [${exception:System.Exception}] {",
744+
"catch {",
745745
"\t",
746746
"}",
747747
"finally {",

0 commit comments

Comments
 (0)