about summary refs log tree commit diff
path: root/tvix/store/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/errors.rs')
-rw-r--r--tvix/store/src/errors.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tvix/store/src/errors.rs b/tvix/store/src/errors.rs
index 25e87c8aa239..36a4320cb3e6 100644
--- a/tvix/store/src/errors.rs
+++ b/tvix/store/src/errors.rs
@@ -26,3 +26,13 @@ impl From<Error> for Status {
         }
     }
 }
+
+// TODO: this should probably go somewhere else?
+impl From<Error> for std::io::Error {
+    fn from(value: Error) -> Self {
+        match value {
+            Error::InvalidRequest(msg) => Self::new(std::io::ErrorKind::InvalidInput, msg),
+            Error::StorageError(msg) => Self::new(std::io::ErrorKind::Other, msg),
+        }
+    }
+}