Macro jupiter::client_error
source · macro_rules! client_error { ($err:expr $(,)?) => { ... }; ($fmt:expr, $($arg:tt)*) => { ... }; }
Expand description
Provides a simple way of creating a CommandError which respesents a ClientError.
Example
use jupiter::commands::{Call, CommandResult};
fn my_command(call: &mut Call) -> CommandResult {
if call.request.parameter_count() > 2 {
Err(jupiter::client_error!(
"This command only accepts 2 parameters but {} were provided",
call.request.parameter_count()
))
} else {
call.response.ok()?;
Ok(())
}
}