From 4d8276790bfa119cd100cbc0e69eaf1e4cd35f52 Mon Sep 17 00:00:00 2001 From: Eugene Tolbakov Date: Wed, 15 Feb 2023 03:42:05 +0000 Subject: [PATCH] refactor(storage): remove unused FlushIo variant (#1002) refactor(storeage): remove unused FlushIo variant --- src/storage/src/error.rs | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/storage/src/error.rs b/src/storage/src/error.rs index f79602002e..1a31737cbf 100644 --- a/src/storage/src/error.rs +++ b/src/storage/src/error.rs @@ -44,12 +44,6 @@ pub enum Error { backtrace: Backtrace, }, - #[snafu(display("Failed to write columns, source: {}", source))] - FlushIo { - source: object_store::Error, - backtrace: Backtrace, - }, - #[snafu(display("Failed to write parquet file, source: {}", source))] WriteParquet { source: parquet::errors::ParquetError, @@ -466,8 +460,7 @@ impl ErrorExt for Error { | EncodeArrow { .. } | ParseSchema { .. } => StatusCode::Unexpected, - FlushIo { .. } - | WriteParquet { .. } + WriteParquet { .. } | ReadObject { .. } | WriteObject { .. } | ListObjects { .. } @@ -530,27 +523,6 @@ mod tests { assert!(err.backtrace_opt().is_some()); } - #[test] - pub fn test_flush_error() { - fn throw_io_error() -> std::result::Result<(), std::io::Error> { - Err(std::io::Error::new( - std::io::ErrorKind::UnexpectedEof, - "writer is closed", - )) - } - - let error = throw_io_error() - .map_err(|err| { - object_store::Error::new(object_store::ErrorKind::Unexpected, "writer close failed") - .set_source(err) - }) - .context(FlushIoSnafu) - .err() - .unwrap(); - assert_eq!(StatusCode::StorageUnavailable, error.status_code()); - assert!(error.backtrace_opt().is_some()); - } - #[test] pub fn test_arrow_error() { fn throw_arrow_error() -> std::result::Result<(), ArrowError> {