error.rs
SHA-256b2488d117600e10161aab2567a13c2f0c2fb0ee2de1242990feccc2767f3658a
Malecule∅
Evidence
1use std::path::PathBuf;
2use std::error::Error;
3use std::{io, fmt};
4
5use super::Environment;
6use self::ConfigError::*;
7
8use yansi::Color::White;
9
10/// The type of a configuration error.
11#[derive(Debug)]
12pub enum ConfigError {
13 /// The current work …
34:19… g, PathBuf),
35 /// A config key was specified with a value of the wrong type.
36 ///
37 /// Parameters: (entry_name, expected_type, actual_type, …
50:14… y(String),
51}
52
53impl ConfigError {
54 /// Prints this configuration error with Rocket formatting.
55 pub fn pretty_print(&self) {
56 let valid_ …
70:2… let valid_entries = format!("{}, and global", valid_envs);
71 error!("[{}] is not a known configuration environment", n …
121:13… _ => false
122 }
123 }
124}
125
126impl fmt::Display for ConfigError {
127 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
128 match *self {