Skip to content

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

Description

@EliteLoser

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions