parser: add read error callback