It's a TypeError because it means that you did `ev.emit('error')` with no error object.