Caught exceptions still appear in global $Error list
Votes from Connect: 3
Original Date Submitted: 9/16/2014 12:15:09 AM
Handle: Aaron Jensen
Site Name: PowerShell
Feedback ID: 972566
Frequency: Always Happens
Regression: Yes, this happens in previous released versions
When you catch exceptions, those exception still appear in the global $Error list. I expect that caught exceptions shouldn't appear there because I'm catching and handling them. We have build pipelines that fail builds if there are any errors in the global $Error variable, and this causes false failures in situations where we are handling the exceptions.
# Caught and handled, Captain!
Note that $Error contains the caught
Product Studio item created by Connect Synchronizer due to creation of feedback ID 972566 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=972566).
Note that $Error contains the
Blarg exception that I caught.
I would expect the $Error variable to be empty, since I caught and handled the error.
Internal BugId: 11002