feder-cr/Jobs_Applier_AI_Agent_AIHawk · error · Exception

Unexpected error in Experience processing: {e}

Error message

Unexpected error in Experience processing: {e}

What it means

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.

Source

Thrown at src/resume_schemas/resume.py:186

                skills_acquired = [str(skill) for skill in exp.get('skills_acquired', [])]
                experience = ExperienceDetails(
                    position=exp['position'],
                    company=exp['company'],
                    employment_period=exp['employment_period'],
                    location=exp['location'],
                    industry=exp['industry'],
                    key_responsibilities=key_responsibilities,
                    skills_acquired=skills_acquired
                )
                experience_list.append(experience)
            except KeyError as e:
                raise KeyError(f"Missing field in experience details: {e}") from e
            except TypeError as e:
                raise TypeError(f"Invalid data for Experience: {e}") from e
            except AttributeError as e:
                raise AttributeError(f"AttributeError in Experience: {e}") from e
            except Exception as e:
                raise Exception(f"Unexpected error in Experience processing: {e}") from e
        return experience_list


@dataclass
class Exam:
    name: str
    grade: str

@dataclass
class Responsibility:
    description: str

View on GitHub (pinned to 79155b52fa)

Solutions

  1. Inspect e.__cause__ and reproduce with the single failing exp dict.
  2. Fix or relax the failing validator, or sanitize the value before construction.
  3. Add a dedicated except ValueError clause for clearer messaging.
  4. Collect per-entry errors instead of aborting the entire experience list.

Example fix

// before
except Exception as e:
    raise Exception(f"Unexpected error in Experience processing: {e}") from e

# after
except ValueError as e:
    raise ValueError(f"Invalid value in Experience: {e}") from e
except Exception as e:
    raise RuntimeError(f"Unexpected error in Experience processing: {e}") from e
Defensive patterns

Strategy: try-catch

Validate before calling

assert all(isinstance(e, dict) for e in data), "experience entries must be dicts"

Try / catch

exp_list = []
for exp in data:
    try:
        exp_list.extend(_process_experience_details([exp]))
    except Exception as e:
        logger.warning("skipping bad experience entry %r: %s", exp, e.__cause__ or e)

Prevention

When it happens

Trigger: A nested constructor or __post_init__ raising ValueError on malformed experience data; date parsing of employment periods failing.

Common situations: Custom validators on the dataclasses; free-text dates from resumes; enum coercion of employment types.

Related errors


AI-assisted analysis of feder-cr/Jobs_Applier_AI_Agent_AIHawk@79155b52fa (2026-08-28). Data as JSON: /api/errors/e4ae487b67727ea9. Report an issue: GitHub.