Software /
code /
prosody-modules
File
.luacheckrc @ 6112:4c0e3fe57e92
mod_compliance_latest: Gracefull error logging on missing dependency.
diff --git a/mod_compliance_latest/README.md b/mod_compliance_latest/README.md
--- a/mod_compliance_latest/README.md
+++ b/mod_compliance_latest/README.md
@@ -9,13 +9,15 @@ rockspec:
# Introduction
-This module will always require and load to the lastest compliance tester we have in the community modules.
-Currently this is [mod_compliance_2023].
+This meta-module will always `require` (and therefore auto-load) the lastest compliance tester we have in the community modules.
+Currently this is [mod_compliance_2023]. See the linked module for further details.
+
+If you do not use the *Prosody plugin installer* this module will likely have limited value to you.
+You can also just install the current compliance tester manually.
# Configuration
-Just load this module as any other module and it will automatically install [mod_compliance_2023] if you use the Prosody plugin installer.
-See the linked module for further details.
+Just load this module as any other module and it will automatically install and load [mod_compliance_2023] if you use the *Prosody plugin installer*.
# Compatibility
diff --git a/mod_compliance_latest/mod_compliance_latest.lua b/mod_compliance_latest/mod_compliance_latest.lua
--- a/mod_compliance_latest/mod_compliance_latest.lua
+++ b/mod_compliance_latest/mod_compliance_latest.lua
@@ -1,1 +1,6 @@
-module:depends("compliance_2023");
+local success, err = pcall(function() module:depends("compliance_2023") end)
+
+if not success then
+ module:log("error", "Error, can't load module: mod_compliance_2023. Is this module downloaded in a folder readable by prosody?")
+ return 1, "Error: Couldn't load dependency mod_compliance_2023."
+end
author | Menel <menel@snikket.de> |
---|---|
date | Mon, 23 Dec 2024 12:58:03 +0100 |
parent | 5778:4a353ccce220 |
child | 6144:1b36cfca6282 |
child | 6208:e20901443eae |
line wrap: on
line source
cache = true codes = true allow_defined_top = true max_line_length = 150 ignore = { "411/err", "421/err", "411/ok", "421/ok", "211/_ENV" }; read_globals = { "prosody", "import", -- Module instance "module.name", "module.host", "module._log", "module.event_handlers", "module.reloading", "module.saved_state", "module.global", "module.path", "module.items", -- Module API "module.add_extension", "module.add_feature", "module.add_identity", "module.add_item", "module.add_timer", "module.weekly", "module.daily", "module.hourly", "module.broadcast", "module.context", "module.default_permission", "module.default_permissions", "module.depends", "module.fire_event", "module.get_directory", "module.get_host", "module.get_host_items", "module.get_host_type", "module.get_name", "module.get_option", "module.get_option_array", "module.get_option_boolean", "module.get_option_enum", "module.get_option_inherited_set", "module.get_option_integer", "module.get_option_number", "module.get_option_path", "module.get_option_period", "module.get_option_scalar", "module.get_option_set", "module.get_option_string", "module.get_status", "module.handle_items", "module.hook", "module.hook_global", "module.hook_object_event", "module.hook_tag", "module.load_resource", "module.log", "module.log_status", "module.may", "module.measure", "module.metric", "module.on_ready", "module.open_store", "module.provides", "module.remove_item", "module.require", "module.send", "module.send_iq", "module.set_global", "module.set_status", "module.shared", "module.unhook", "module.unhook_object_event", "module.wrap_event", "module.wrap_global", "module.wrap_object_event", -- mod_http API "module.http_url", } globals = { -- Methods that can be set on module API "module.unload", "module.add_host", "module.load", "module.add_host", "module.save", "module.restore", "module.command", "module.environment", }