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 more detailed error message to database open failures. #317

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dominicletz
Copy link
Contributor

No description provided.

Comment on lines +324 to +326
const char* msg = sqlite3_errmsg(db);
int code = sqlite3_system_errno(db);
snprintf(error_msg, sizeof(error_msg), "%s (errno: %d)", msg, code);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me think about this a little bit more. This changes the method signature from {:error, atom()} to {:error, atom() | String.t()}. I think maybe the better solution would be to do something like {:error, {:database_open_failed, code(), String.t()}}

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

Successfully merging this pull request may close these issues.

2 participants