<!DOCTYPE html>
<html lang="en" >
<head>
	<meta charset="utf-8">
	<title>Promise chain</title>
</head>
<body>
	<pre>Console output only</pre>
	<script>
		addEventListener('error', function(error) {
			console.log("------------")
		  console.log(error)
		}, false)


		addEventListener('unhandledrejection', function(event) {
		  console.log(event.promise) // [object Promise] - the promise that generated the error
		  console.log(event.reason) // Error: Whoops! - the unhandled error object
		})

	</script>
	<s