fix improper error message on parse failure

@radumereuta please review