trap parsing errors