Will throw an exception on 'error' event.