Enum gpp::Error [−][src]
pub enum Error {
InvalidCommand {
command_name: String,
},
TooManyParameters {
command: &'static str,
},
UnexpectedCommand {
command: &'static str,
},
ChildFailed {
status: ExitStatus,
},
PipeFailed,
IoError(Error),
FromUtf8Error(FromUtf8Error),
FileError {
filename: String,
line: usize,
error: Box<Error>,
},
}
Expand description
Error enum for parsing errors.
Examples
let error = gpp::Error::TooManyParameters { command: "my_command" };
assert_eq!(format!("{}", error), "Too many parameters for #my_command");
let error = gpp::Error::FileError {
filename: "my_file".to_string(),
line: 10,
error: Box::new(gpp::Error::UnexpectedCommand {
command: "this_command",
}),
};
assert_eq!(format!("{}", error), "Error in my_file:10: Unexpected command #this_command");
Variants
An unknown command was encountered.
Fields of InvalidCommand
command_name: String
Too many parameters were given for a command (for example using #endif with parameters).
Fields of TooManyParameters
command: &'static str
There was an unexpected command; currently only generated for unexpected #endins.
Fields of UnexpectedCommand
command: &'static str
The child process for an #exec exited with a nonzero status.
Fields of ChildFailed
status: ExitStatus
A pipe was unable to be set up to the child.
IoError(Error)
An error with I/O occurred.
Tuple Fields of IoError
0: Error
FromUtf8Error(FromUtf8Error)
An error occurred parsing a child’s standard output as UTF-8.
Tuple Fields of FromUtf8Error
An error occurred in another file.
Trait Implementations
Performs the conversion.