I think it would be cleaner (and a smaller diff) if you keep the existing code. But then add a `handle_error` method that is called in the case of an error instead of always returning stop.