{"record":{"id":"53f7709ccf6ea1fe","repo":"feder-cr/Jobs_Applier_AI_Agent_AIHawk","slug":"an-unexpected-error-occurred-while-processing-avai","errorCode":null,"errorMessage":"An unexpected error occurred while processing availability.","messagePattern":"An unexpected error occurred while processing availability\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/resume_schemas/job_application_profile.py","lineNumber":152,"sourceCode":"            raise RuntimeError(\"An unexpected error occurred while processing work_preferences.\") from e\n\n        # Process availability\n        try:\n            logger.debug(\"Processing availability\")\n            self.availability = Availability(**data['availability'])\n            logger.debug(f\"Availability processed: {self.availability}\")\n        except KeyError as e:\n            logger.error(f\"Required field {e} is missing in availability data.\")\n            raise KeyError(f\"Required field {e} is missing in availability data.\") from e\n        except TypeError as e:\n            logger.error(f\"Error in availability data: {e}\")\n            raise TypeError(f\"Error in availability data: {e}\") from e\n        except AttributeError as e:\n            logger.error(f\"Attribute error in availability processing: {e}\")\n            raise AttributeError(\"Attribute error in availability processing.\") from e\n        except Exception as e:\n            logger.error(f\"An unexpected error occurred while processing availability: {e}\")\n            raise RuntimeError(\"An unexpected error occurred while processing availability.\") from e\n\n        # Process salary_expectations\n        try:\n            logger.debug(\"Processing salary_expectations\")\n            self.salary_expectations = SalaryExpectations(**data['salary_expectations'])\n            logger.debug(f\"salary_expectations processed: {self.salary_expectations}\")\n        except KeyError as e:\n            logger.error(f\"Required field {e} is missing in salary_expectations data.\")\n            raise KeyError(f\"Required field {e} is missing in salary_expectations data.\") from e\n        except TypeError as e:\n            logger.error(f\"Error in salary_expectations data: {e}\")\n            raise TypeError(f\"Error in salary_expectations data: {e}\") from e\n        except AttributeError as e:\n            logger.error(f\"Attribute error in salary_expectations processing: {e}\")\n            raise AttributeError(\"Attribute error in salary_expectations processing.\") from e\n        except Exception as e:\n            logger.error(f\"An unexpected error occurred while processing salary_expectations: {e}\")\n            raise RuntimeError(\"An unexpected error occurred while processing salary_expectations.\") from e","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/feder-cr/Jobs_Applier_AI_Agent_AIHawk/blob/79155b52faccfbd19b834680af285eac70dd2df4/src/resume_schemas/job_application_profile.py#L134-L170","documentation":"Generic RuntimeError wrapping any non-KeyError/TypeError/AttributeError failure during availability processing in JobApplicationProfile.__init__. Like its siblings, it fires when a nested validator raises something like ValueError, and the true error is only recoverable from the chained exception. Treat it as 'availability data failed an unanticipated check'.","triggerScenarios":"Availability's nested date parsing or enum coercion raising ValueError during **-construction; any custom exception from subclassed models.","commonSituations":"Date strings in unexpected formats inside availability; library version adding stricter availability validation; locale-dependent date formats in resumes.","solutions":["Check e.__cause__ for the original exception and message.","Reproduce by calling Availability(**data['availability']) with the same payload.","Fix or normalize the failing value (e.g. standardize date strings), and add a specific except clause for the recurring exception type."],"exampleFix":"# before\nexcept Exception as e:\n    raise RuntimeError(\"An unexpected error occurred while processing availability.\") from e\n\n# after\nexcept ValueError as e:\n    raise ValueError(f\"Invalid availability data: {e}\") from e\nexcept Exception as e:\n    raise RuntimeError(f\"Unexpected availability failure: {e!r}\") from e","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    profile = JobApplicationProfile(**data)\nexcept RuntimeError as e:\n    if 'availability' in str(e):\n        handle(e.__cause__)","preventionTips":["Normalize date strings before loading","Keep chained exceptions for diagnostics","Test nested validators with real data"],"tags":["python","runtime-error","availability","constructor"],"backgroundTag":"schema-validation-failed","analyzedSha":"79155b52faccfbd19b834680af285eac70dd2df4","analyzedAt":"2026-08-28T14:10:26.659Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}