From 58fe0d1b4bae48f643878f45bc612a9840d5c0a4 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 13 Nov 2023 10:28:45 +0100 Subject: [PATCH] Improve error message for disabled model --- src/emu/model.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/emu/model.c b/src/emu/model.c index 74918ec..cbff52c 100644 --- a/src/emu/model.c +++ b/src/emu/model.c @@ -128,17 +128,21 @@ model_connect(struct model *model, struct emu *emu) int model_event(struct model *model, struct emu *emu, int index) { + struct model_spec *spec = model->spec[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; } 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; } - struct model_spec *spec = model->spec[index]; if (spec->event == NULL) return 0;