(offset: int, length: int, chunk_size: int)
| 134 | |
| 135 | |
| 136 | def _validate_range(offset: int, length: int, chunk_size: int) -> None: |
| 137 | if offset < 0: |
| 138 | raise BlockExtractionError( |
| 139 | f"Invalid offset: {offset}", |
| 140 | "Invalid offset: expected value >= 0.", |
| 141 | ) |
| 142 | if length <= 0: |
| 143 | raise BlockExtractionError( |
| 144 | f"Invalid length: {length}", |
| 145 | "Invalid length: expected value > 0.", |
| 146 | ) |
| 147 | if chunk_size <= 0: |
| 148 | raise BlockExtractionError( |
| 149 | f"Invalid chunk size: {chunk_size}", |
| 150 | "Invalid chunk size: expected value > 0.", |
| 151 | ) |
| 152 | |
| 153 | |
| 154 | def _get_open_error_message(source_path: str, error: OSError) -> str: |
no test coverage detected