Convert query-pull/ to PullError.
This commit is contained in:
parent
0e4991fa26
commit
d6569a6a22
2 changed files with 15 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ use mentat_query::{
|
|||
|
||||
pub mod errors;
|
||||
|
||||
use errors::{
|
||||
pub use errors::{
|
||||
PullError,
|
||||
Result,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue