parser.py: Writer: write_record method: exceptions handling improved