2016-01-21 17:42:43 +00:00
|
|
|
use std::error::Error;
|
|
|
|
use std::fmt::Display;
|
|
|
|
use std::fmt::Formatter;
|
|
|
|
use std::fmt::Error as FmtError;
|
2016-03-24 11:29:42 +00:00
|
|
|
use std::io::Error as IOError;
|
2016-01-21 17:42:43 +00:00
|
|
|
|
2016-05-15 14:53:31 +00:00
|
|
|
generate_error_types!(RuntimeError, RuntimeErrorKind,
|
|
|
|
Instantiate => "Could not instantiate",
|
|
|
|
IOError => "IO Error",
|
|
|
|
ProcessExitFailure => "Process exited with failure"
|
|
|
|
);
|
2016-01-21 17:42:43 +00:00
|
|
|
|
2016-03-24 11:29:42 +00:00
|
|
|
impl From<IOError> for RuntimeError {
|
|
|
|
|
|
|
|
fn from(ioe: IOError) -> RuntimeError {
|
|
|
|
RuntimeError::new(RuntimeErrorKind::IOError, Some(Box::new(ioe)))
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|