getsentry / sentry-powershell

Sentry for PowerShell
MIT License
4 stars 0 forks source link

Powershell Errors Are Not Being Reported #49

Open ReneGreen27 opened 2 weeks ago

ReneGreen27 commented 2 weeks ago

Production environment Windows 32

User cannot send an event via powershell project. They've tried on 3 different devices, checked that the DSN is correct. All sampling is at 1.0 and no explicit errors in their output logs other than a generic

"PS C:\WINDOWS\system32> "Something went wrong" | Out-Sentry"

Project is able to receive events successfully when sending events directly to the API rather than using powershell.

Steps to Reproduce

Send event via powershell exactly as directed in our documentation: https://docs.sentry.io/platforms/powershell/

try
{
    throw 'Test error'
}
catch
{
    $_ | Out-Sentry
}

Expected Result

Test error event to be successfully sent and received

Actual Result

No error event received

vaind commented 1 week ago

I can repro the issue on windows powershell 5.1. Some stack frame module path is an empty string & Test-Path throws when checking. I'll add a test case and a fix.

vaind commented 1 week ago

I was wrong about the cause of the issue. Instead, it looks like the event is not being sent by the HttpTransport. Still need to figure out why.

In the meantime, I suggest upgrading to PowerShell 7 if that is an option for you.