Skip to content

Instantly share code, notes, and snippets.

@lantrix
Forked from akimboyko/gist:4258647
Last active August 29, 2015 14:08
Show Gist options
  • Save lantrix/303b6b62495d22aaef2b to your computer and use it in GitHub Desktop.
Save lantrix/303b6b62495d22aaef2b to your computer and use it in GitHub Desktop.
Write-Host 'throw'
try
{
try
{
throw "exception"
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
throw
}
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
Write-Host $err
}
Write-Host 'throw (exception)'
try
{
try
{
$exception = New-Object System.Exception ("test")
throw $exception
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
throw
}
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
Write-Host $err
}
Write-Host 'throw $_'
try
{
try
{
$exception = New-Object System.Exception ("test")
throw $exception
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
throw $_
}
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
Write-Host $err
}
Write-Host 'throw $_.Exception'
try
{
try
{
$exception = New-Object System.Exception ("test")
throw $exception
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
throw $_.Exception
}
}
catch
{
Write-Host $_
Write-Host $_.GetType()
Write-Host $_.Exception
Write-Host $_.Exception.StackTrace
Write-Host $err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment