Extract error parsing function