Convert query-pull/ to PullError.

This commit is contained in:
Nick Alexander 2018-06-27 11:53:02 -07:00
parent 0e4991fa26
commit d6569a6a22
2 changed files with 15 additions and 6 deletions

View file

@ -10,15 +10,15 @@
use std; // To refer to std::result::Result.
use mentat_db::{
DbError,
};
use mentat_core::{
Entid,
};
use failure::{
Error,
};
pub type Result<T> = std::result::Result<T, Error>;
pub type Result<T> = std::result::Result<T, PullError>;
#[derive(Debug, Fail)]
pub enum PullError {
@ -27,4 +27,13 @@ pub enum PullError {
#[fail(display = ":db/id repeated")]
RepeatedDbId,
#[fail(display = "{}", _0)]
DbError(#[cause] DbError),
}
impl From<DbError> for PullError {
fn from(error: DbError) -> PullError {
PullError::DbError(error)
}
}

View file

@ -102,7 +102,7 @@ use mentat_query::{
pub mod errors;
use errors::{
pub use errors::{
PullError,
Result,
};