forked from github/server
fail fast for wrong message parameters
simplifies debugging
This commit is contained in:
parent
5535beed61
commit
96b7c92d81
|
@ -194,6 +194,7 @@ message *msg_message(const char *name, const char *sig, ...)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error("invalid parameter %s for message type %s\n", paramname, mtype->name);
|
log_error("invalid parameter %s for message type %s\n", paramname, mtype->name);
|
||||||
|
assert(!"invalid parameter for message type");
|
||||||
}
|
}
|
||||||
while (*ic && !isalnum(*ic))
|
while (*ic && !isalnum(*ic))
|
||||||
ic++;
|
ic++;
|
||||||
|
@ -201,6 +202,7 @@ message *msg_message(const char *name, const char *sig, ...)
|
||||||
va_end(vargs);
|
va_end(vargs);
|
||||||
if (argnum != mtype->nparameters) {
|
if (argnum != mtype->nparameters) {
|
||||||
log_error("not enough parameters for message type %s\n", mtype->name);
|
log_error("not enough parameters for message type %s\n", mtype->name);
|
||||||
|
assert(!"not enough parameters for message type");
|
||||||
}
|
}
|
||||||
|
|
||||||
return msg_create(mtype, args);
|
return msg_create(mtype, args);
|
||||||
|
|
Loading…
Reference in New Issue