It could be Dojo is using proper Error handling methods (i.e. try-catch blocks) which prevents the exception from bubbling up and reaching the window container, on which you have registered the error handler.
If so, there is no way for you to do this. No error is going past the catch block, so no error handler is being called.
As pointed out by the comments, you can also use browser-specific debugging APIs like the Venkman hook and do break-on-error — a solution that usually only works for privileged code (thanks to @Sam Hanes).
You can also do On(require, 'error', function () {});
to add error handling on DOJO’s asynchronous script loader — another point mentioned in the comments by @buggedcom