changed parser errors to raise Python errors