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

Add character offset to error message #1778

Open
thebinarysearchtree opened this issue Apr 13, 2024 · 0 comments · May be fixed by #1779
Open

Add character offset to error message #1778

thebinarysearchtree opened this issue Apr 13, 2024 · 0 comments · May be fixed by #1779

Comments

@thebinarysearchtree
Copy link

Summary

Currently, when an error occurs, an Error object is thrown with the error message. When debugging errors in SQL, it is very useful to know where in the SQL the error occurred. Therefore, a custom error object should be thrown with error offset information included.

Proposed implementation

sqlite3_error_offset should be called after sqlite3_errmsg to obtain the offset within the SQL that caused the error. It will be -1 if the problem does not relate to the SQL syntax itself. This should be returned in JavaScript via a custom Error class that includes the message as standard, and the offset as additional information.

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

Successfully merging a pull request may close this issue.

1 participant