{"record":{"id":"4ef72011d80d4b7d","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"unexpected-error-in-education-processing-e","errorCode":null,"errorMessage":"Unexpected error in Education processing: {e}","messagePattern":"Unexpected error in Education processing: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/resume.py","lineNumber":157,"sourceCode":"                exams = [Exam(name=k, grade=v) for k, v in edu.get('exam', {}).items()]\n                education = EducationDetails(\n                    education_level=edu.get('education_level'),\n                    institution=edu.get('institution'),\n                    field_of_study=edu.get('field_of_study'),\n                    final_evaluation_grade=edu.get('final_evaluation_grade'),\n                    start_date=edu.get('start_date'),\n                    year_of_completion=edu.get('year_of_completion'),\n                    exam=exams\n                )\n                education_list.append(education)\n            except KeyError as e:\n                raise KeyError(f\"Missing field in education details: {e}\") from e\n            except TypeError as e:\n                raise TypeError(f\"Invalid data for Education: {e}\") from e\n            except AttributeError as e:\n                raise AttributeError(f\"AttributeError in Education: {e}\") from e\n            except Exception as e:\n                raise Exception(f\"Unexpected error in Education processing: {e}\") from e\n        return education_list\n\n    def _process_experience_details(self, data: List[Dict[str, Any]]) -> List[ExperienceDetails]:\n        experience_list = []\n        for exp in data:\n            try:\n                key_responsibilities = [\n                    Responsibility(description=list(resp.values())[0])\n                    for resp in exp.get('key_responsibilities', [])\n                ]\n                skills_acquired = [str(skill) for skill in exp.get('skills_acquired', [])]\n                experience = ExperienceDetails(\n                    position=exp['position'],\n                    company=exp['company'],\n                    employment_period=exp['employment_period'],\n                    location=exp['location'],\n                    industry=exp['industry'],\n                    key_responsibilities=key_responsibilities,","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/resume.py#L139-L175","documentation":"Generic fallback for EducationDetails processing when the failure is neither KeyError, TypeError, nor AttributeError — e.g. ValueError from Exam(name=..., grade=...) validation, or exceptions from converters in the construction chain. The true cause is chained via __cause__.","triggerScenarios":"Exam or EducationDetails __post_init__ raising ValueError on bad grades/dates; a nested converter choking on an unexpected value type.","commonSituations":"Custom validators inside the dataclasses; date parsing of 'start_date'; enum coercion.","solutions":["Inspect e.__cause__ for the real exception and message; reproduce with the single offending edu dict.","Fix or relax the underlying validator / pre-clean the value.","Add a specific except clause (e.g. except ValueError) ahead of the generic one for clearer diagnostics.","Consider isolating entries: wrap the body in a per-entry try and collect errors instead of failing the whole list."],"exampleFix":"// before\nexcept Exception as e:\n    raise Exception(f\"Unexpected error in Education processing: {e}\") from e\n\n# after\nexcept ValueError as e:\n    raise ValueError(f\"Invalid value in Education: {e}\") from e\nexcept Exception as e:\n    raise RuntimeError(f\"Unexpected error in Education processing: {e}\") from e","handlingStrategy":"try-catch","validationCode":"# minimal sanity check; full prevention not possible for arbitrary nested exceptions\nassert all(isinstance(e, dict) for e in data), \"education entries must be dicts\"","typeGuard":null,"tryCatchPattern":"edu_list = []\nfor edu in data:\n    try:\n        edu_list.extend(_process_education_details([edu]))\n    except Exception as e:\n        logger.warning(\"skipping bad education entry %r: %s\", edu, e.__cause__ or e)","preventionTips":["Process entries individually so one failure doesn't kill the batch","Inspect __cause__ for the true error","Keep validators' exception types documented"],"tags":["catch-all","dataclass","python"],"backgroundTag":"nested-constructor-exception","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}