From 75079963714b6633847f05d015e1adcfde11a8f6 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 28 Aug 2020 12:40:59 +0100 Subject: util.error: Allow optional tracebacks to be injected on errors This allows extra debug info to be provided for development purposes. --- util/startup.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util/startup.lua') diff --git a/util/startup.lua b/util/startup.lua index 01ca585b..40021981 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -546,6 +546,10 @@ function startup.init_gc() return true; end +function startup.init_errors() + require "util.error".configure(config.get("*", "error_library")); +end + function startup.make_host(hostname) return { type = "local", @@ -577,6 +581,7 @@ function startup.prosodyctl() startup.force_console_logging(); startup.init_logging(); startup.init_gc(); + startup.init_errors(); startup.setup_plugindir(); -- startup.setup_plugin_install_path(); startup.setup_datadir(); @@ -600,6 +605,7 @@ function startup.prosody() startup.read_config(); startup.init_logging(); startup.init_gc(); + startup.init_errors(); startup.sanity_check(); startup.sandbox_require(); startup.set_function_metatable(); -- cgit v1.2.3