Error reporting fails when assigning undefined as callback event