Bug 577760: Unify parser APIs and error handling Follow-up-to: a5b730ae4fcfc88422a0ebf762cf1bd811ace567 Change-Id: Ie7a78e713d200de135d42e2bdda15c8aa4672468