diff --git a/pgtoolkit/errors.py b/pgtoolkit/errors.py index d3c2672..229d279 100644 --- a/pgtoolkit/errors.py +++ b/pgtoolkit/errors.py @@ -1,12 +1,13 @@ from __future__ import annotations +from dataclasses import dataclass + +@dataclass class ParseError(Exception): - def __init__(self, lineno: int, line: str, message: str) -> None: - self.message = message - super().__init__(self.message) - self.lineno = lineno - self.line = line + lineno: int + line: str + message: str def __repr__(self) -> str: return f"<{self.__class__.__name__} at line {self.lineno}: {self.message:.32}>"