Skip to content

Commit

Permalink
Implement error
Browse files Browse the repository at this point in the history
  • Loading branch information
liurenjie1024 committed Dec 4, 2019
1 parent 6e645ca commit d3e238d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rust/arrow/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<T> = ::std::result::Result<T, ArrowError>;

0 comments on commit d3e238d

Please sign in to comment.