// // imag - the personal information management suite for the commandline // Copyright (C) 2015, 2016 Matthias Beyer 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 { LinkError, LinkErrorKind, ResultExt, Result; } errors { EntryHeaderReadError { description("Error while reading an entry header") display("Error while reading an entry header") } EntryHeaderWriteError { description("Error while writing an entry header") display("Error while writing an entry header") } ExistingLinkTypeWrong { description("Existing link entry has wrong type") display("Existing link entry has wrong type") } LinkTargetDoesNotExist { description("Link target does not exist in the store") display("Link target does not exist in the store") } LinkParserError { description("Link cannot be parsed") display("Link cannot be parsed") } LinkParserFieldMissingError { description("Link cannot be parsed: Field missing") display("Link cannot be parsed: Field missing") } LinkParserFieldTypeError { description("Link cannot be parsed: Field type wrong") display("Link cannot be parsed: Field type wrong") } InternalConversionError { description("Error while converting values internally") display("Error while converting values internally") } InvalidUri { description("URI is not valid") display("URI is not valid") } StoreReadError { description("Store read error") display("Store read error") } StoreWriteError { description("Store write error") display("Store write error") } StoreIdError { description("StoreId handling error") display("StoreId handling error") } } } pub use self::error::LinkError; pub use self::error::LinkErrorKind; pub use self::error::MapErrInto; impl IntoError for LinkErrorKind { type Target = LinkError; fn into_error(self) -> Self::Target { LinkError::from_kind(self) } fn into_error_with_cause(self, cause: Box) -> Self::Target { LinkError::from_kind(self) } }