libits/client/configuration/
configuration_error.rs

1/*
2 * Software Name : libits-client
3 * SPDX-FileCopyrightText: Copyright (c) Orange SA
4 * SPDX-License-Identifier: MIT
5 *
6 * This software is distributed under the MIT license,
7 * see the "LICENSE.txt" file for more details or https://opensource.org/license/MIT/
8 *
9 * Authors: see CONTRIBUTORS.md
10 */
11
12use thiserror::Error;
13
14#[derive(Error, Debug)]
15pub enum ConfigurationError {
16    #[error("{0}")]
17    BootstrapFailure(String),
18    #[error("Could not found field '{0}'")]
19    FieldNotFound(&'static str),
20    #[error("Cannot parse '{0}' due to invalid file type")]
21    InvalidFileType(String),
22    #[error("Configuration missing mandatory field {0} in section {1}")]
23    MissingMandatoryField(&'static str, &'static str),
24    #[error("Configuration missing mandatory section: {0}")]
25    MissingMandatorySection(&'static str),
26    #[error("No custom settings found in configuration")]
27    NoCustomSettings,
28    #[error("Could not found section '{0}'")]
29    SectionNotFound(&'static str),
30    #[error("Could not parse value of field '{0}' as a '{1}'")]
31    TypeError(&'static str, &'static str),
32    #[error("Username provided with no password")]
33    NoPassword,
34}