Shepherd to handle errors