about summary refs log tree commit diff
path: root/tvix/castore/src/errors.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-12T17·26+0200
committerflokli <flokli@flokli.de>2023-10-14T12·26+0000
commit9757bf637791b8c2169225990682e5d42141e97d (patch)
treedd96f0a063d75e30e722b1581bda52517ae75481 /tvix/castore/src/errors.rs
parent3f011d276253852c58559fc12cf9e26bd17ed853 (diff)
refactor(tvix/*store): helper for channel creation from url r/6802
This moves the repetitive code to parse a URL and create a channel
connected to it into `tvix_castore::channel::from_url`.

Part of b/308

Change-Id: Idd342cd71cad5e78a9b258b38c1b227993e75310
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9707
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to 'tvix/castore/src/errors.rs')
-rw-r--r--tvix/castore/src/errors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/castore/src/errors.rs b/tvix/castore/src/errors.rs
index 3b23f972b045..9f596afd4e26 100644
--- a/tvix/castore/src/errors.rs
+++ b/tvix/castore/src/errors.rs
@@ -34,6 +34,12 @@ impl From<Error> for Status {
     }
 }
 
+impl From<crate::channel::Error> for Error {
+    fn from(value: crate::channel::Error) -> Self {
+        Self::StorageError(value.to_string())
+    }
+}
+
 // TODO: this should probably go somewhere else?
 impl From<Error> for std::io::Error {
     fn from(value: Error) -> Self {