{"record":{"id":"e4ae487b67727ea9","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"unexpected-error-in-experience-processing-e","errorCode":null,"errorMessage":"Unexpected error in Experience processing: {e}","messagePattern":"Unexpected error in Experience processing: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/resume.py","lineNumber":186,"sourceCode":"                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,\n                    skills_acquired=skills_acquired\n                )\n                experience_list.append(experience)\n            except KeyError as e:\n                raise KeyError(f\"Missing field in experience details: {e}\") from e\n            except TypeError as e:\n                raise TypeError(f\"Invalid data for Experience: {e}\") from e\n            except AttributeError as e:\n                raise AttributeError(f\"AttributeError in Experience: {e}\") from e\n            except Exception as e:\n                raise Exception(f\"Unexpected error in Experience processing: {e}\") from e\n        return experience_list\n\n\n@dataclass\nclass Exam:\n    name: str\n    grade: str\n\n@dataclass\nclass Responsibility:\n    description: str","sourceCodeStart":168,"sourceCodeEnd":197,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/resume.py#L168-L197","documentation":"Catch-all for ExperienceDetails processing when the failure is not KeyError/TypeError/AttributeError — typically a ValueError from validation/conversion (dates, enums) inside the constructor chain. The original exception is chained as __cause__ and must be inspected to find the real fault.","triggerScenarios":"A nested constructor or __post_init__ raising ValueError on malformed experience data; date parsing of employment periods failing.","commonSituations":"Custom validators on the dataclasses; free-text dates from resumes; enum coercion of employment types.","solutions":["Inspect e.__cause__ and reproduce with the single failing exp dict.","Fix or relax the failing validator, or sanitize the value before construction.","Add a dedicated except ValueError clause for clearer messaging.","Collect per-entry errors instead of aborting the entire experience list."],"exampleFix":"// before\nexcept Exception as e:\n    raise Exception(f\"Unexpected error in Experience processing: {e}\") from e\n\n# after\nexcept ValueError as e:\n    raise ValueError(f\"Invalid value in Experience: {e}\") from e\nexcept Exception as e:\n    raise RuntimeError(f\"Unexpected error in Experience processing: {e}\") from e","handlingStrategy":"try-catch","validationCode":"assert all(isinstance(e, dict) for e in data), \"experience entries must be dicts\"","typeGuard":null,"tryCatchPattern":"exp_list = []\nfor exp in data:\n    try:\n        exp_list.extend(_process_experience_details([exp]))\n    except Exception as e:\n        logger.warning(\"skipping bad experience entry %r: %s\", exp, e.__cause__ or e)","preventionTips":["Batch-process per entry to isolate failures","Inspect __cause__ for the root exception","Keep nested validators' failure modes covered by tests"],"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"}