config_file_handler/error.rs
1// Copyright 2018 MaidSafe.net limited.
2//
3// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
4// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
5// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
6// modified, or distributed except according to those terms. Please review the Licences for the
7// specific language governing permissions and limitations relating to use of the SAFE Network
8// Software.
9
10use serde_json::Error as JsonError;
11use std::env::VarError;
12use std::io::Error as IoError;
13
14quick_error! {
15 /// Error types.
16 #[derive(Debug)]
17 pub enum Error {
18 /// Wrapper for a `::std::env::VarError`
19 Env(err: VarError) {
20 description("Environment error")
21 display("Environment error: {}", err)
22 cause(err)
23 from()
24 }
25 /// Wrapper for a `::std::io::Error`
26 Io(err: IoError) {
27 description("IO error")
28 display("IO error: {}", err)
29 cause(err)
30 from()
31 }
32 /// Wrapper for a `::serde_json::Error`
33 JsonParser(err: JsonError) {
34 description("Json parse error")
35 display("Json parse error: {}", err)
36 cause(err)
37 from()
38 }
39 }
40}