Fix for error throwing from default onerror handler