Skip to content

Navigation Menu

Sign in
Sign up

Add more detailed error message to database open failures. - #317

Open
dominicletz wants to merge 2 commits into
elixir-sqlite:main from
dominicletz:main
Open

Add more detailed error message to database open failures. #317
dominicletz wants to merge 2 commits into
elixir-sqlite:main from
dominicletz:main

Conversation

@dominicletz

@dominicletz dominicletz commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread c_src/sqlite3_nif.c
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);

@warmwaffles warmwaffles Jan 29, 2025

Copy link
Copy Markdown
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()}}

dominicletz and mjc reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@warmwaffles warmwaffles warmwaffles left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /