Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibsqlError should explcitly contain an explanation of the error #15

Open
CodingDoug opened this issue Aug 2, 2023 · 0 comments
Open

Comments

@CodingDoug
Copy link

class LibsqlError(RuntimeError):
    code: str

    def __init__(self, message: str, code: str):
        super(RuntimeError, self).__init__(f"{code}: {message}")
        self.code = code

We have a code, which is normally the SQLite error code, such as SQLITE_CONSTRAINT, but the message of the error doesn't have representation here. The developer must dig into args to make some assumptions about what's there. It would be better if message was also a field here with the English explanation of the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant