about summary refs log tree commit diff
path: root/tvix/store/src/errors.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-02-26T21·31+0100
committerflokli <flokli@flokli.de>2023-03-10T10·58+0000
commit0baaabc43e3027b1676874c536d5ade27abe14b8 (patch)
tree918d3d645a405d187038fae2944431d85eba9d1d /tvix/store/src/errors.rs
parentd8ab140d2505aa1669bc9378012d736dfa19cac4 (diff)
refactor(tvix/store): move blob splitting into a BlobWriter struct r/5927
This will moves the chunking-as-we-receive logic that so far only lived
in grpc_blobservice_wrapper.rs into a generic BlobWriter.

Change-Id: Ief7d1bda3c6280129f7139de3f6c4174be2ca6ea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8154
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
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 25e87c8aa2..36a4320cb3 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),
+        }
+    }
+}