Functions/Get-Puppeteer_ThrowExceptionOnUnhandledRejection.ps1

<#
.SYNOPSIS
    This function returns the Node JS Puppeteer code for throwing an exception upon encountering an unhandled rejection.
#>

function Get-Puppeteer_ThrowExceptionOnUnhandledRejection {
    [CmdletBinding(PositionalBinding=$true)]
    [OutputType([String])]
    param ()
    return "process.on('unhandledRejection', up => { throw up })"
}