From d3e238dd217e1f588e3a4075e53985f81e90de12 Mon Sep 17 00:00:00 2001 From: Renjie Liu Date: Wed, 4 Dec 2019 22:17:14 +0800 Subject: [PATCH] Implement error --- rust/arrow/src/error.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rust/arrow/src/error.rs b/rust/arrow/src/error.rs index e9a92358f2ff2..62afd37ae4c68 100644 --- a/rust/arrow/src/error.rs +++ b/rust/arrow/src/error.rs @@ -17,6 +17,7 @@ //! Defines `ArrowError` for representing failures in various Arrow operations use std::error::Error; +use std::fmt::{Display, Formatter}; use csv as csv_crate; @@ -70,4 +71,12 @@ impl From<::std::string::FromUtf8Error> for ArrowError { } } +impl Display for ArrowError { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "Arrow error happened!") + } +} + +impl Error for ArrowError {} + pub type Result = ::std::result::Result;