use a custom emitter to throw the error; then test for it