From 3f27fe34843357e8782ae3357ab1f7ed272ccfca Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 3 Mar 2023 22:32:07 +0100 Subject: [PATCH] feat(tvix/store): impl From for Error Change-Id: Ib61e276b45c0102e383a7e7e641172b151369b03 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8207 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/store/src/errors.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tvix/store/src/errors.rs b/tvix/store/src/errors.rs index 003c619b7..7f7474428 100644 --- a/tvix/store/src/errors.rs +++ b/tvix/store/src/errors.rs @@ -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 From> for Error { + fn from(value: PoisonError) -> Self { + Error::StorageError(value.to_string()) + } +}