fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        match self.info {
            ErrorInfo::ErrorReadingFile(ref file, ref cause) => {
                writeln!(formatter, "Error reading file: {}", file)?;
                match cause {
                    Some(cause_err) => cause_err.fmt(formatter),
                    None => Ok(()),
                }
            }
            ErrorInfo::Initialization(ref message) => write!(formatter, "{}", message),
            ErrorInfo::Runtime(ref message, ref meta_info) => {
                let empty_meta_data = InstructionMetaInfo::new();
                let meta_info_value = meta_info.as_ref().unwrap_or(&empty_meta_data);
                format_error_message(formatter, &meta_info_value, message)
            }
            ErrorInfo::PreProcessNoCommandFound(ref meta_info) => {
                format_error_message(formatter, &meta_info, "preprocessor is missing a command")
            }
            ErrorInfo::ControlWithoutValidValue(ref meta_info) => format_error_message(
                formatter,
                &meta_info,
                "control character found without a valid value",
            ),
            ErrorInfo::InvalidControlLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid control character location")
            }
            ErrorInfo::MissingEndQuotes(ref meta_info) => {
                format_error_message(formatter, &meta_info, "missing end quotes")
            }
            ErrorInfo::MissingOutputVariableName(ref meta_info) => {
                format_error_message(formatter, &meta_info, "missing variable name")
            }
            ErrorInfo::InvalidEqualsLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid equals sign location")
            }
            ErrorInfo::InvalidQuotesLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid quotes location")
            }
            ErrorInfo::EmptyLabel(ref meta_info) => {
                format_error_message(formatter, &meta_info, "empty lable found")
            }
            ErrorInfo::UnknownPreProcessorCommand(ref meta_info) => {
                format_error_message(formatter, &meta_info, "unknow preprocessor command")
            }
        }
    }
/// Formats the script error using the given formatter.
Formats the script error using the given formatter.
Formats the script error using the given formatter .
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        match self.info {
            ErrorInfo::ErrorReadingFile(ref file, ref cause) => {
                writeln!(formatter, "Error reading file: {}", file)?;
                match cause {
                    Some(cause_err) => cause_err.fmt(formatter),
                    None => Ok(()),
                }
            }
            ErrorInfo::Initialization(ref message) => write!(formatter, "{}", message),
            ErrorInfo::Runtime(ref message, ref meta_info) => {
                let empty_meta_data = InstructionMetaInfo::new();
                let meta_info_value = meta_info.as_ref().unwrap_or(&empty_meta_data);
                format_error_message(formatter, &meta_info_value, message)
            }
            ErrorInfo::PreProcessNoCommandFound(ref meta_info) => {
                format_error_message(formatter, &meta_info, "preprocessor is missing a command")
            }
            ErrorInfo::ControlWithoutValidValue(ref meta_info) => format_error_message(
                formatter,
                &meta_info,
                "control character found without a valid value",
            ),
            ErrorInfo::InvalidControlLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid control character location")
            }
            ErrorInfo::MissingEndQuotes(ref meta_info) => {
                format_error_message(formatter, &meta_info, "missing end quotes")
            }
            ErrorInfo::MissingOutputVariableName(ref meta_info) => {
                format_error_message(formatter, &meta_info, "missing variable name")
            }
            ErrorInfo::InvalidEqualsLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid equals sign location")
            }
            ErrorInfo::InvalidQuotesLocation(ref meta_info) => {
                format_error_message(formatter, &meta_info, "invalid quotes location")
            }
            ErrorInfo::EmptyLabel(ref meta_info) => {
                format_error_message(formatter, &meta_info, "empty lable found")
            }
            ErrorInfo::UnknownPreProcessorCommand(ref meta_info) => {
                format_error_message(formatter, &meta_info, "unknow preprocessor command")
            }
        }
    }
fn fmt ( & self , formatter : & mut fmt :: Formatter ) -> Result < ( ) , fmt :: Error > { match self . info { ErrorInfo :: ErrorReadingFile ( ref file , ref cause ) => { writeln ! ( formatter " " file ) ? ; match cause { Some ( cause_err ) => cause_err . fmt ( formatter ) , None => Ok ( ( ) ) , } } ErrorInfo :: Initialization ( ref message ) => write ! ( formatter " " message ) , ErrorInfo :: Runtime ( ref message , ref meta_info ) => { let empty_meta_data = InstructionMetaInfo :: new ( ) ; let meta_info_value = meta_info . as_ref ( ) . unwrap_or ( & empty_meta_data ) ; format_error_message ( formatter , & meta_info_value , message ) } ErrorInfo :: PreProcessNoCommandFound ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: ControlWithoutValidValue ( ref meta_info ) => format_error_message ( formatter , & meta_info , " " , ) , ErrorInfo :: InvalidControlLocation ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: MissingEndQuotes ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: MissingOutputVariableName ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: InvalidEqualsLocation ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: InvalidQuotesLocation ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: EmptyLabel ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } ErrorInfo :: UnknownPreProcessorCommand ( ref meta_info ) => { format_error_message ( formatter , & meta_info , " " ) } } }
Formats the script error using the given formatter.
Formats the script error using the given formatter .
&self
formatter
&mut fmt::Formatter