Function ext_php_rs::php::exceptions::throw   [−][src]
pub fn throw(ex: &ClassEntry, message: &str) -> Result<()>Expand description
Throws an exception with a given message. See ClassEntry for some built-in exception
types.
Returns a result containing nothing if the exception was successfully thown.
Parameters
- ex- The exception type to throw.
- message- The message to display when throwing the exception.
Examples
use ext_php_rs::php::{class::ClassEntry, exceptions::throw};
throw(ClassEntry::compile_error(), "This is a CompileError.");