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

SqliteConnection::query_row should return formal error type if there is no row to return #79

Closed
dashed opened this issue Nov 9, 2015 · 3 comments

Comments

@dashed
Copy link

dashed commented Nov 9, 2015

The following error return isn't all that useful: https://github.com/jgallagher/rusqlite/blob/7586556db5b4ad4db94e5e6ab5232f8868b8f5c9/src/lib.rs#L299-L302

And capturing the error through string comparison message isn't a good solution.

I think it may be useful to have error types that can be externally captured via rusqlite as a library.

This may require SqliteError to be an enum or something.

@jgallagher
Copy link
Contributor

@dashed Continuing with the "better late than never" theme, I have a local branch that does indeed change SqliteError to an enum. It sprouted several more cases than I was expecting, where we were (ab)using SQLite error codes for errors occurring on the Rust side. The change is relatively minor but quite widespread, so I'm going to wait for the currently-open PRs to get finished and merged in. This is coming soon though!

@dashed
Copy link
Author

dashed commented Dec 15, 2015

Awesome to hear! 👍 I'm definitely looking forward to seeing this on master.

@jgallagher
Copy link
Contributor

@dashed merged into master. Please give it a shot and let me know if there are any issues!

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

2 participants