Skip to content

Instantly share code, notes, and snippets.

@novemberborn
Created June 6, 2012 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novemberborn/14c8266d22444dc6f030 to your computer and use it in GitHub Desktop.
Save novemberborn/14c8266d22444dc6f030 to your computer and use it in GitHub Desktop.
Instrument deferred rejections
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<script>
var dojoConfig = {
async: true,
deferredEnableInstrumentation: true
};
</script>
<script src="../dojo/dojo.js"></script>
<script>
require(["dojo/Deferred", "dojo/promise/instrumenting!report-rejections"], function(Deferred, reportErrors){
var d = new Deferred();
d.reject(new Error("ooooops!"));
});
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<script>
var dojoConfig = {
async: true,
deferredEnableInstrumentation: true
};
</script>
<script src="../dojo/dojo.js"></script>
<script>
require(["dojo/Deferred", "dojo/promise/instrumenting!report-unhandled-rejections"], function(Deferred, reportErrors){
var d = new Deferred();
d.reject(new Error("ooooops!"));
setTimeout(function(){
d.promise.then().otherwise(function(){});
}, 500);
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment