aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/framework')
-rw-r--r--src/ext/framework/mod.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ext/framework/mod.rs b/src/ext/framework/mod.rs
index 085bf2c..c580d76 100644
--- a/src/ext/framework/mod.rs
+++ b/src/ext/framework/mod.rs
@@ -133,14 +133,21 @@ macro_rules! command {
($fname:ident($c:ident, $m:ident, $a:ident, $($name:ident: $t:ty),*) $b:block) => {
pub fn $fname($c: &Context, $m: &Message, $a: Vec<String>) -> Result<(), String> {
let mut i = $a.iter();
+ let mut arg_counter = 0;
$(
+ arg_counter += 1;
+
let $name = match i.next() {
Some(v) => match v.parse::<$t>() {
Ok(v) => v,
- Err(_) => return Err(format!("Failed to parse {:?}", stringify!($t))),
+ Err(_) => return Err(format!("Failed to parse argument #{} of type {:?}",
+ arg_counter,
+ stringify!($t))),
},
- None => return Err(format!("Failed to parse {:?}", stringify!($t))),
+ None => return Err(format!("Failed to parse argument #{} of type {:?}",
+ arg_counter,
+ stringify!($t))),
};
)*