Skip to content

Log the error returned from SqliteStore::new and fs::create_dir_all#893

Merged
tnull merged 2 commits intolightningdevkit:mainfrom
tankyleo:2026-04-log-sqlitestore-setup-err
May 5, 2026
Merged

Log the error returned from SqliteStore::new and fs::create_dir_all#893
tnull merged 2 commits intolightningdevkit:mainfrom
tankyleo:2026-04-log-sqlitestore-setup-err

Conversation

@tankyleo
Copy link
Copy Markdown
Contributor

This matches the logging done when setting up a VSS store.

This matches the logging done when setting up a VSS store.
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 30, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo tankyleo requested a review from tnull April 30, 2026 23:22
@ldk-reviews-bot
Copy link
Copy Markdown

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Hmm, it' a bit unfortunate that we now doubly-instantiate the logger. The pattern is pre-existing for VSS, but if we do this, maybe we want to introduce a build_with_store_and_logger internal method that all other build_with methods (including build_with_store) use, to avoid having to doubly setting up the logger every time?

This internal method allows us to avoid instantiating the logger twice
during the creation of a `Node`.
@tankyleo
Copy link
Copy Markdown
Contributor Author

tankyleo commented May 4, 2026

Thanks for the review, I added a commit to make this change, let me know if you would prefer to squash it with the previous one.

@tankyleo tankyleo requested a review from tnull May 4, 2026 19:12
@tankyleo tankyleo mentioned this pull request May 4, 2026
Comment thread src/builder.rs
.map_err(|_| BuildError::KVStoreSetupFailed)?;
self.build_with_store(node_entropy, kv_store)
.map_err(|e| {
log_error!(logger, "Failed to setup Sqlite store: {}", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: here and below

Suggested change
log_error!(logger, "Failed to setup Sqlite store: {}", e);
log_error!(logger, "Failed to set up Sqlite store: {}", e);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll land this shortly to keep moving, but feel free to add a commit addressing the nit in #863.

Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM! Landing this to unblock #863.

Comment thread src/builder.rs
.map_err(|_| BuildError::KVStoreSetupFailed)?;
self.build_with_store(node_entropy, kv_store)
.map_err(|e| {
log_error!(logger, "Failed to setup Sqlite store: {}", e);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll land this shortly to keep moving, but feel free to add a commit addressing the nit in #863.

@tnull tnull merged commit 109978d into lightningdevkit:main May 5, 2026
22 checks passed
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.

4 participants