Enum rocket::config::ConfigError [−][src]
pub enum ConfigError {
NotFound,
IoError,
Io(Error, &'static str),
BadFilePath(PathBuf, &'static str),
BadEnv(String),
BadEntry(String, PathBuf),
BadType(String, &'static str, &'static str, Option<PathBuf>),
ParseError(String, PathBuf, String, Option<(usize, usize)>),
BadEnvVal(String, String, String),
UnknownKey(String),
Missing(String),
}
Expand description
The type of a configuration error.
Variants
The configuration file was not found.
There was an I/O error while reading the configuration file.
There was an I/O error while setting a configuration parameter.
Parameters: (io_error, config_param_name)
The path at which the configuration file was found was invalid.
Parameters: (path, reason)
BadEnv(String)
An environment specified in ROCKET_ENV
is invalid.
Parameters: (environment_name)
Tuple Fields of BadEnv
0: String
An environment specified as a table [environment]
is invalid.
Parameters: (environment_name, filename)
A config key was specified with a value of the wrong type.
Parameters: (entry_name, expected_type, actual_type, filename)
There was a TOML parsing error.
Parameters: (toml_source_string, filename, error_description, line/col)
There was a TOML parsing error in a config environment variable.
Parameters: (env_key, env_value, error)
UnknownKey(String)
The entry (key) is unknown.
Parameters: (key)
Tuple Fields of UnknownKey
0: String
Missing(String)
The entry (key) was expected but was missing.
Parameters: (key)
Tuple Fields of Missing
0: String
Implementations
Prints this configuration error with Rocket formatting.
Returns true
if self
is of NotFound
variant.
Example
use rocket::config::ConfigError;
let error = ConfigError::NotFound;
assert!(error.is_not_found());