Add a handler for uncaught script errors and log them as grunt errors.