Refactor the code so we can set our own message for parser error.