Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Int divided by zero causes a script-terminating error in RavenPowerShell.psm1 #3

Open
EliteLoser opened this issue Nov 13, 2018 · 0 comments

Comments

@EliteLoser
Copy link

Hi. Integers divided by zero for some reason cause an error. Pasting a part of a transcript. Using the latest GitHub version of RavenPowerShell.psm1, and a recent Sentry instance.

It appears to be an encoding issue somehow, with what's transferred to Sentry.

PS C:\temp> try { 1 / 0 } catch { $RavenClient.CaptureException($_) }

PS C:\temp> TerminatingError(Invoke-RestMethod): "{"error":"Bad data decoding request (UnicodeDecodeError, 'utf8' codec can't decode byte 0xf8 in position 24: invalid start byte)"}"

Invoke-RestMethod : {"error":"Bad data decoding request (UnicodeDecodeError, 'utf8' codec can't decode byte 0xf8 in position 24: invalid start byte)"}

At C:\temp\RavenPowerShell.psm1:63 char:9

+         Invoke-RestMethod -Uri $this.storeUri -Method Post -Body $jso ...

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException

    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Invoke-RestMethod : {"error":"Bad data decoding request (UnicodeDecodeError, 'utf8' codec can't decode byte 0xf8 in position 24: invalid start byte)"}

At C:\temp\RavenPowerShell.psm1:63 char:9

+         Invoke-RestMethod -Uri $this.storeUri -Method Post -Body $jso ...

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException

    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand


PS C:\temp> # hm...
PS C:\temp> try { $null[3] } catch { $RavenClient.CaptureException($_) }

PS C:\temp> try { $null[3] / 0 } catch { $RavenClient.CaptureException($_) }

PS C:\temp> # int divided by zero causes Raven to fail, what about decimal?

PS C:\temp> try { 1.1 / 0 } catch { $RavenClient.CaptureException($_) }

∞

PS C:\temp> # infinity, hm..

PS C:\temp> Stop-Transcript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant