Rewrite the exception handling procedure for the new parser