INNER CODE UNIT · Python

__init__

koxudaxi/datamodel-code-generator · src/datamodel_code_generator/__init__.py:622

    def __init__(
        self,
        original_error: Exception,
        input_file_type: InputFileType | None = None,
        *,
        source: str | Path | None = None,
    ) -> None:
        """Initialize with original error, input file type, and source context."""
        self.original_error = original_error
        self.input_file_type = input_file_type
        self.source = source
        error_detail = f"{type(original_error).__name__}: {original_error}"
        source_detail = f" at {source}" if source is not None else ""
        if input_file_type is not None:
            message = f"Invalid file format for {input_file_type.value}{source_detail}: {error_detail}"
        else:
            message = f"Invalid file format{source_detail}: {error_detail}"
        super().__init__(message=message)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…