diff --git a/main/loader.c b/main/loader.c index 08139af605..370e41fa40 100644 --- a/main/loader.c +++ b/main/loader.c @@ -589,8 +589,16 @@ int ast_module_reload(const char *name) if (name && resource_name_match(name, cur->resource)) continue; - if (!cur->flags.running || cur->flags.declined) - continue; + if (!cur->flags.running || cur->flags.declined) { + if (!name) + continue; + ast_log(LOG_NOTICE, "The module '%s' was not properly initialized. " + "Before reloading the module, you must run \"module load %s\" " + "and fix whatever is preventing the module from being initialized.\n", + name, name); + res = 2; /* Don't report that the module was not found */ + break; + } if (!info->reload) { /* cannot be reloaded */ if (res < 1) /* store result if possible */