rename fail to emitError