I/O errors
| 64 | super().__init__(f"Connection error: {message}") |
| 65 | |
| 66 | class IoError(GraphLiteError): |
| 67 | """I/O errors""" |
| 68 | def __init__(self, message: str): |
| 69 | super().__init__(f"I/O error: {message}") |
| 70 | |
| 71 | @classmethod |
| 72 | def from_io_error(cls, error: OSError) -> "IoError": |
| 73 | """Create IoError from Python OSError (IOError in Python 3)""" |
| 74 | filename = getattr(error, 'filename', None) or '' |
| 75 | strerror = getattr(error, 'strerror', None) or str(error) |
| 76 | return cls(f"{strerror}: {filename}" if filename else strerror) |
| 77 | |
| 78 | |
| 79 | # ============================================================================ |
no outgoing calls
no test coverage detected