parameterize full parser function with some error handlers