emit error rather than throw since client is an event emitter