pub enum JavaError {
Io(String),
CompilationFailed(String),
RuntimeFailed(String),
InvalidUtf8(FromUtf8Error),
InvalidChar,
}Expand description
Re-export the core error type and runtime helpers.
All errors that java! and java_fn! can return at runtime (and that
ct_java! maps to compile_error! diagnostics at build time).
Variants§
Io(String)
An I/O error while creating the temp directory, writing the source
file, or spawning javac/java (e.g. the binary is not on PATH).
CompilationFailed(String)
javac exited with a non-zero status. The 0 field contains the
compiler diagnostic output (stderr).
RuntimeFailed(String)
The JVM exited with a non-zero status (e.g. an unhandled exception).
The 0 field contains the exception message and stack trace (stderr).
InvalidUtf8(FromUtf8Error)
The Java run() method returned a String whose bytes are not valid
UTF-8.
InvalidChar
The Java run() method returned a char value that is not a valid
Unicode scalar (i.e. a lone surrogate half).
Trait Implementations§
Source§impl Error for JavaError
impl Error for JavaError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()