~matthiasbeyer/imag

ref: d12844aff04b4b78e5aba3e79f0ba79da7326b4f imag/lib/entry/libimagentryview/src/error.rs -rw-r--r-- 1.9 KiB
d12844afMatthias Beyer Add markdown viewer functionality 3 years ago
                                                                                                    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// 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 {
        ViewError, ViewErrorKind, ResultExt, Result;
    }

    foreign_links {
        Failure(::failure::Compat<::failure::Error>) #[cfg(feature = "markdownviewer")];
        IO(::std::io::Error);
    }

    links {
        StoreError(::libimagstore::error::StoreError, ::libimagstore::error::StoreErrorKind);
    }

    errors {
        Unknown              {
            description("Unknown view error")
            display("Unknown view error")
        }

        GlobError            {
            description("Error while glob()ing")
            display("Error while glob()ing")
        }

        PatternError         {
            description("Error in glob() pattern")
            display("Error in glob() pattern")
        }

        PatternBuildingError {
            description("Could not build glob() pattern")
            display("Could not build glob() pattern")
        }

        ViewError            {
            description("Failed to start viewer")
            display("Failed to start viewer")
        }

    }
}