Skip to content

Commit 426397f

Browse files
author
Devdutt Shenoi
committed
refactor: return instead of panic
1 parent 2c43745 commit 426397f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/storage/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ pub enum ObjectStorageError {
262262

263263
#[error("JoinError: {0}")]
264264
JoinError(#[from] JoinError),
265+
266+
#[error("Arrow Error: {0}")]
267+
Arrow(#[from] arrow_schema::ArrowError),
265268
}
266269

267270
pub fn to_object_store_path(path: &RelativePath) -> Path {

src/storage/object_storage.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,14 @@ pub trait ObjectStorage: Debug + Send + Sync + 'static {
879879
Ok(())
880880
}
881881

882+
/// Stores updated schema in storage
882883
async fn commit_schema(
883884
&self,
884885
stream_name: &str,
885886
schema: Schema,
886887
) -> Result<(), ObjectStorageError> {
887888
let stream_schema = self.get_schema(stream_name).await?;
888-
let new_schema = Schema::try_merge(vec![schema, stream_schema]).unwrap();
889+
let new_schema = Schema::try_merge(vec![schema, stream_schema])?;
889890
self.put_schema(stream_name, &new_schema).await
890891
}
891892
}

0 commit comments

Comments
 (0)