Improve error message for disabled model

This commit is contained in:
Rodrigo Arias 2023-11-13 10:28:45 +01:00
parent 72b7eb8332
commit 58fe0d1b4b

View File

@ -128,17 +128,21 @@ model_connect(struct model *model, struct emu *emu)
int int
model_event(struct model *model, struct emu *emu, int index) model_event(struct model *model, struct emu *emu, int index)
{ {
struct model_spec *spec = model->spec[index];
if (!model->registered[index]) { if (!model->registered[index]) {
err("model not registered for '%c'", (char) index); err("model not registered for event %s", emu->ev->mcv);
return -1; return -1;
} }
if (!model->enabled[index]) { if (!model->enabled[index]) {
err("model not enabled for '%c'", (char) index); err("model %s not enabled for event %s",
spec->name, emu->ev->mcv);
info("missing call to ovni_thread_require(\"%s\", \"%s\")?",
spec->name, spec->version);
return -1; return -1;
} }
struct model_spec *spec = model->spec[index];
if (spec->event == NULL) if (spec->event == NULL)
return 0; return 0;