/// Turn native error codes into meaningful and user-readable strings
Turn native error codes into meaningful and user-readable strings
Turn native error codes into meaningful and user - readable strings
pub fn translate_error(code: &NativeError) -> String {
    match code {
        &NativeError::NoError => "No error has occurred.",
        &NativeError::NotAvailable => "The functionality is not available in this virtual machine.",
        &NativeError::MustPossessCapability => "The capability being used is false in this environment.",
        &NativeError::NullPointer => "Pointer is unexpectedly NULL.",
        &NativeError::OutOfMemory => "The function attempted to allocate memory and no more memory was available for allocation.",
        &NativeError::NotEnabled => "The desired functionality has not been enabled in this virtual machine.",
        &NativeError::WrongPhase => "The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running.",
        &NativeError::UnexpectedInternalError => "An unexpected internal error has occurred.",
        &NativeError::ThreadNotAttached => "The thread being used to call this function is not attached to the virtual machine. Calls must be made from attached threads.",
        &NativeError::Disconnected => "The JVM TI environment provided is no longer connected or is not an environment.",
        &NativeError::NotImplemented => "This function is not implemented yet",
        &NativeError::UnknownError => "Unknown error."
    }.to_string()
}
pub fn translate_error ( code : & NativeError ) -> String { match code { & NativeError :: NoError => " " , & NativeError :: NotAvailable => " " , & NativeError :: MustPossessCapability => " " , & NativeError :: NullPointer => " " , & NativeError :: OutOfMemory => " " , & NativeError :: NotEnabled => " " , & NativeError :: WrongPhase => " " , & NativeError :: UnexpectedInternalError => " " , & NativeError :: ThreadNotAttached => " " , & NativeError :: Disconnected => " " , & NativeError :: NotImplemented => " " , & NativeError :: UnknownError => " " } . to_string ( ) }
Turn native error codes into meaningful and user-readable strings
Turn native error codes into meaningful and user - readable strings
code
&NativeError