raise useful exceptions when asked to parse invalid strings