diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-29 10:18:59 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-04-29 11:43:32 +0200 |
commit | 30ac77d62645a805dc3bff7569319cdedd7a93da (patch) | |
tree | d1f9a2d484f12c64d398244658e9d4d35c1883e3 /lib | |
parent | e08ec34893f924ef57dfe0c99afe0f9ceddcda28 (diff) |
Add error module
Diffstat (limited to 'lib')
-rw-r--r-- | lib/entry/libimagentryfilter/Cargo.toml | 1 | ||||
-rw-r--r-- | lib/entry/libimagentryfilter/src/error.rs | 34 | ||||
-rw-r--r-- | lib/entry/libimagentryfilter/src/lib.rs | 2 |
3 files changed, 37 insertions, 0 deletions
diff --git a/lib/entry/libimagentryfilter/Cargo.toml b/lib/entry/libimagentryfilter/Cargo.toml index b1e81f83..8cbc8e59 100644 --- a/lib/entry/libimagentryfilter/Cargo.toml +++ b/lib/entry/libimagentryfilter/Cargo.toml @@ -27,6 +27,7 @@ regex = "0.2" semver = "0.8" toml = "0.4" toml-query = "0.6" +error-chain = "0.11" libimagstore = { version = "0.8.0", path = "../../../lib/core/libimagstore" } libimagentrytag = { version = "0.8.0", path = "../../../lib/entry/libimagentrytag" } diff --git a/lib/entry/libimagentryfilter/src/error.rs b/lib/entry/libimagentryfilter/src/error.rs new file mode 100644 index 00000000..370b3fb9 --- /dev/null +++ b/lib/entry/libimagentryfilter/src/error.rs @@ -0,0 +1,34 @@ +// +// imag - the personal information management suite for the commandline +// Copyright (C) 2015-2018 Matthias Beyer <mail@beyermatthias.de> and contributors +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; version +// 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +error_chain! { + + types { + FilterError, FilterErrorKind, ResultExt, Result; + } + + foreign_links { + TomlQueryError(::toml_query::error::Error); + } + + errors { + } + +} + diff --git a/lib/entry/libimagentryfilter/src/lib.rs b/lib/entry/libimagentryfilter/src/lib.rs index 68917fb2..b7870fe1 100644 --- a/lib/entry/libimagentryfilter/src/lib.rs +++ b/lib/entry/libimagentryfilter/src/lib.rs @@ -38,6 +38,7 @@ extern crate regex; extern crate semver; extern crate toml; extern crate toml_query; +#[macro_use] extern crate error_chain; extern crate libimagstore; extern crate libimagentrytag; @@ -46,6 +47,7 @@ extern crate libimagentrytag; // these depend only on libimagstore pub mod builtin; +pub mod error; // extended functionality of the crate // these depend on other internal libraries than libimagstore and use the upper core modules for |