public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
<!DOCTYPE html>
<html>
<head>
<title>Airbrakeiojs</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
<script type="text/javascript">
//<![CDATA[
var notifierJsScheme = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + notifierJsScheme + "airbrake.io/javascripts/notifier.js' type='text/javascript'%3E%3C/script%3E"));
//]]>
</script>
 
<script type="text/javascript">
Hoptoad.setKey('yourkey');
Hoptoad.setHost('api.airbrake.io');
Hoptoad.setEnvironment('production');
Hoptoad.setErrorDefaults({
url: "http://example.com/pages/home",
component: "pages",
action: "show"
});
</script>
 
<script type="text/javascript">
 
 
var x=prompt("Enter a number between 5 and 10:","");
try
{
if(x>10)
{
throw "Err1";
}
else if(x<5)
{
throw "Err2";
}
else if(isNaN(x))
{
throw "Err3";
}
}
catch(err)
{
if(err=="Err1")
{
document.write("Error! The value is too high.");
}
if(err=="Err2")
{
document.write("Error! The value is too low.");
}
if(err=="Err3")
{
document.write("Error! The value is not a number.");
}
}
 
try {
throw n; // throws an exception with a numeric value
} catch (e) {
if (e <= 50) {
// statements to handle exceptions 1-50
} else {
// cannot handle this exception, so rethrow
throw e;
}
}
</script>
</head>
<body>
 
<%= yield %>
 
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.