promiseのerror
<apex:page>
    <html>
        <head>
        </head>
        <body>
            <script type="text/javascript">
                Promise.resolve()
                .then(() => {
                    // Makes .then() return a rejected promise
                    throw new Error('Oh no!');
                })
                .then(() => {
                    console.log('Not called.');
                }, error => {
                    console.error('onRejected function called: ' + error.message);
                });
                
            </script>
        </body>
    </html>
</apex:page>結果
