Skip to content

Error handling - #32

Merged
bengybade merged 2 commits into
mainfrom
supiket/error-handling
Oct 17, 2025
Merged

Error handling#32
bengybade merged 2 commits into
mainfrom
supiket/error-handling

Conversation

@bengybade

@bengybade bengybade commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Closes #20

@bengybade
bengybade requested review from freesig and nfurfaro October 15, 2025 20:15
@bengybade
bengybade marked this pull request as ready for review October 15, 2025 20:15
// Process block.
let state_transition_func =
this.state_transition_func.take().expect("is always Some");
let pre_extension = this.pre_extension.take().expect("is always Some");

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 thought that the pre and post extensions were optional and might very well be None... I may have imagined that though.

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.

Ah, ignore my previous comment, this is fine in this context.

Comment thread crates/types/src/lib.rs
{
let mut lock = self.lock.lock().unwrap();
// Not attempting poison recovery.
let mut lock = self.lock.lock().expect("poisoned lock");

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 think this is ok? We're trying to build our software to avoid panics so I would think that a PoisonError should never happen in production. (Not in general, but in parts ofvoid-base dealing with locks specifically).

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.

If it's poisoned then something has panicked so the only thing you can really do is also panic

@freesig freesig left a comment

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.

Nice

@bengybade
bengybade merged commit 71f3146 into main Oct 17, 2025
9 checks passed
@bengybade
bengybade deleted the supiket/error-handling branch October 17, 2025 21:26
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.

Return and Handle Errors

3 participants