feder-cr/Jobs_Applier_AI_Agent_AIHawk · error · RuntimeError

An unexpected error occurred while processing self_identific

Error message

An unexpected error occurred while processing self_identification.

What it means

Catch-all RuntimeError from the self_identification try block in JobApplicationProfile.__init__: any exception that is not KeyError/TypeError/AttributeError while building SelfIdentification is re-raised as this generic RuntimeError. The original exception is chained, so the actual failure is only visible via __cause__ or logs. It almost always indicates a bug or unexpected value type deep in nested model constructors.

Source

Thrown at src/resume_schemas/job_application_profile.py:98

            raise TypeError("YAML data must be a dictionary.")

        # Process self_identification
        try:
            logger.debug("Processing self_identification")
            self.self_identification = SelfIdentification(**data['self_identification'])
            logger.debug(f"self_identification processed: {self.self_identification}")
        except KeyError as e:
            logger.error(f"Required field {e} is missing in self_identification data.")
            raise KeyError(f"Required field {e} is missing in self_identification data.") from e
        except TypeError as e:
            logger.error(f"Error in self_identification data: {e}")
            raise TypeError(f"Error in self_identification data: {e}") from e
        except AttributeError as e:
            logger.error(f"Attribute error in self_identification processing: {e}")
            raise AttributeError("Attribute error in self_identification processing.") from e
        except Exception as e:
            logger.error(f"An unexpected error occurred while processing self_identification: {e}")
            raise RuntimeError("An unexpected error occurred while processing self_identification.") from e

        # Process legal_authorization
        try:
            logger.debug("Processing legal_authorization")
            self.legal_authorization = LegalAuthorization(**data['legal_authorization'])
            logger.debug(f"legal_authorization processed: {self.legal_authorization}")
        except KeyError as e:
            logger.error(f"Required field {e} is missing in legal_authorization data.")
            raise KeyError(f"Required field {e} is missing in legal_authorization data.") from e
        except TypeError as e:
            logger.error(f"Error in legal_authorization data: {e}")
            raise TypeError(f"Error in legal_authorization data: {e}") from e
        except AttributeError as e:
            logger.error(f"Attribute error in legal_authorization processing: {e}")
            raise AttributeError("Attribute error in legal_authorization processing.") from e
        except Exception as e:
            logger.error(f"An unexpected error occurred while processing legal_authorization: {e}")
            raise RuntimeError("An unexpected error occurred while processing legal_authorization.") from e

View on GitHub (pinned to 79155b52fa)

Solutions

  1. Read the chained original exception (raise ... from e) to identify the true failing field/validator.
  2. Reproduce with the same data dict constructing SelfIdentification directly in a REPL.
  3. Fix the offending value or validator, then retry JobApplicationProfile construction.
  4. Add a targeted except clause for the real exception type instead of relying on the generic handler.

Example fix

# before
try:
    profile = JobApplicationProfile(**data)
except RuntimeError as e:
    pass  # cause unknown

# after
try:
    profile = JobApplicationProfile(**data)
except RuntimeError as e:
    logging.error("root cause: %r", e.__cause__)
    raise
Defensive patterns

Strategy: try-catch

Try / catch

try:
    profile = JobApplicationProfile(**data)
except RuntimeError as e:
    cause = e.__cause__
    if 'self_identification' in str(e):
        handle_section_failure('self_identification', cause)

Prevention

When it happens

Trigger: SelfIdentification (or a nested model) raising ValueError, IndexError, or a custom exception during **data['self_identification'] construction; anything outside the three specific except clauses.

Common situations: Version drift between resume data and schema classes (a nested validator now raises ValueError); date parsing or enum coercion failures inside nested constructors; partially migrated data files.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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