I'd like to be able to reject dojo/Deferred objects without this being shown as errors in the browser's console. Many of these rejections aren't actual errors. They're only rejections, part of processes that didn't follow their main path of execution but which didn't end up in a catastrophe either. I'm even more bothered about these spurious error reports since I capture the error logs and send them to a server for possible further analysis (large product in beta testing phase).
Has anyone done it ?
// assuming we're running in a Dojo environment
var d = new Deferred();
d.reject("I don't want to see this on the console !");
Sure, you just have to
.catch() the rejections somewhere (and ignore them if you want). It's the same for synchronously
thrown errors - if you don't wrap the code in a
catch, the exceptions will show up in the console. You need to do that explicitly, because otherwise it will be considered an unexpected error/rejection and be logged as such.