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 {
|
||||
log_error("invalid parameter %s for message type %s\n", paramname, mtype->name);
|
||||
assert(!"invalid parameter for message type");
|
||||
}
|
||||
while (*ic && !isalnum(*ic))
|
||||
ic++;
|
||||
|
@ -201,6 +202,7 @@ message *msg_message(const char *name, const char *sig, ...)
|
|||
va_end(vargs);
|
||||
if (argnum != mtype->nparameters) {
|
||||
log_error("not enough parameters for message type %s\n", mtype->name);
|
||||
assert(!"not enough parameters for message type");
|
||||
}
|
||||
|
||||
return msg_create(mtype, args);
|
||||
|
|
Loading…
Reference in New Issue