Skip to content

Commit

Permalink
ARROW-7312: [Rust] Implement std::error::Error for ArrowError.
Browse files Browse the repository at this point in the history
Add this implementation so that others can handle errors from arrow crate better.

Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits:

f27683a <Renjie Liu> Fix comment
d3e238d <Renjie Liu> Implement error

Authored-by: Renjie Liu <liurenjie2008@gmail.com>
Signed-off-by: Neville Dipale <nevilledips@gmail.com>
  • Loading branch information
liurenjie1024 authored and andy-thomason committed Feb 24, 2020
1 parent 1a95bac commit 4e54ef3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rust/arrow/src/error.rs
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 @@ -72,6 +73,9 @@ impl From<::std::string::FromUtf8Error> for ArrowError {
}

<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> ARROW-7312: [Rust] Implement std::error::Error for ArrowError.
impl Display for ArrowError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Expand All @@ -94,7 +98,10 @@ impl Display for ArrowError {

impl Error for ArrowError {}

<<<<<<< HEAD
pub type Result<T> = std::result::Result<T, ArrowError>;
=======
=======
>>>>>>> ARROW-7312: [Rust] Implement std::error::Error for ArrowError.
pub type Result<T> = ::std::result::Result<T, ArrowError>;
>>>>>>> Rebase master

0 comments on commit 4e54ef3

Please sign in to comment.