Fix onerror test

Fixes the tests.

Which leaves: "investigate a better solution that still works with the built-in async and pluggable async mechanisms (that doesn't bloat file size)".  What's the problem with the current solution?