Last active
March 30, 2017 22:44
-
-
Save JNaeemGitonga/d29c5376ac3e2b247628358d46a9245b to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/xihoba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.error-report { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.error-report { | |
color: red; | |
} | |
</style> | |
</head> | |
<body> | |
<main> | |
<h1>Handling errors</h1> | |
<p class="error-report js-error-report"></p> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
</main> | |
<script id="jsbin-javascript"> | |
function main() { | |
doAllTheThings(); | |
} | |
function doAllTheThings() { | |
throw { | |
message: "Everything's ruined", | |
name: "FatalException", | |
toString: function(){return this.name + ": " + this.message;} | |
} | |
} | |
function reportError(e) { | |
$('.js-error-report').text("Uh oh, something went wrong! Here's what we know: " + e.message); | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! | |
*/ | |
$(main); | |
</script> | |
<script id="jsbin-source-css" type="text/css">* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.error-report { | |
color: red; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function main() { | |
doAllTheThings(); | |
} | |
function doAllTheThings() { | |
throw { | |
message: "Everything's ruined", | |
name: "FatalException", | |
toString: function(){return this.name + ": " + this.message;} | |
} | |
} | |
function reportError(e) { | |
$('.js-error-report').text("Uh oh, something went wrong! Here's what we know: " + e.message); | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! | |
*/ | |
$(main);</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
doAllTheThings(); | |
} | |
function doAllTheThings() { | |
throw { | |
message: "Everything's ruined", | |
name: "FatalException", | |
toString: function(){return this.name + ": " + this.message;} | |
} | |
} | |
function reportError(e) { | |
$('.js-error-report').text("Uh oh, something went wrong! Here's what we know: " + e.message); | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! | |
*/ | |
$(main); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment