feat(tvix/store): impl From<PoisonError> for Error

Change-Id: Ib61e276b45c0102e383a7e7e641172b151369b03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8207
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Florian Klink 2023-03-03 22:32:07 +01:00 committed by flokli
parent 786854713c
commit 3f27fe3484

View file

@ -1,3 +1,4 @@
use std::sync::PoisonError;
use thiserror::Error;
/// Errors related to communication with the store.
@ -9,3 +10,9 @@ pub enum Error {
#[error("internal storage error: {0}")]
StorageError(String),
}
impl<T> From<PoisonError<T>> for Error {
fn from(value: PoisonError<T>) -> Self {
Error::StorageError(value.to_string())
}
}