mandiant / mandiant/VM-Packages
exception catch in vm.common.psm1 may not be working
- Dominant language
- PowerShell
- Stars
- 246
- Forks
- 98
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 7
Description
### Details
At the beginning of `packages/common.vm/tools/vm.common/vm.common.psm1`, we set `$ErrorActionPreference = 'Stop'` and we do the same at the beginning of many packages. Isn't this causing that the `catch` when an exception occurs is not executed as the program immediately exits? @MalwareMechanic you introduced some of this exception handling to render errors better in the logs. Do you have more insight here?
Contributor guide
Research direction
Start at the $ErrorActionPreference assignment in packages/common.vm/tools/vm.common/vm.common.psm1 and inspect the surrounding catch handling used for log errors. Reproduce an exception with the current setting and verify whether the catch executes; done means the behavior is confirmed and any needed error-handling change is reflected in the logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100