aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-06-19 13:00:58 +0100
committerGravatar Sadie Powell2026-06-19 15:35:38 +0100
commita2981a9e35ab987a621d8ac8bb1b85e424939c48 (patch)
treefad52f8e5df5c84fcf7129ad9a7269f53c5fe489 /src/modules.cpp
parentMerge branch 'insp4' into master. (diff)
Rework error reporting and shutting down.
- Clean up InspIRCd::Cleanup and document it better. - Bring back QuickExit for error reporting during shutdown. - Deduplicate logging of error messages to stdout and files.
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 4f9586773..b465a5044 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -522,7 +522,7 @@ void ModuleManager::LoadAll()
if (!this->Load(name, true))
{
fmt::println("[{}] {}", fmt::styled("*", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)), LastError());
- ServerInstance->Exit(EXIT_FAILURE);
+ ServerInstance->Exit(EXIT_FAILURE, "A module failed to load");
}
}
@@ -541,7 +541,7 @@ void ModuleManager::LoadAll()
LastModuleError = "Unable to initialize " + modname + ": " + modexcept.GetReason();
ServerInstance->Logs.Critical("MODULE", LastModuleError);
fmt::println("[{}] {}", fmt::styled("*", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)), LastModuleError);
- ServerInstance->Exit(EXIT_FAILURE);
+ ServerInstance->Exit(EXIT_FAILURE, "A module failed to initialize");
}
}
@@ -563,12 +563,12 @@ void ModuleManager::LoadAll()
LastModuleError = "Unable to read the configuration for " + modname + ": " + modexcept.GetReason();
ServerInstance->Logs.Critical("MODULE", LastModuleError);
fmt::println("[{}] {}", fmt::styled("*", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)), LastModuleError);
- ServerInstance->Exit(EXIT_FAILURE);
+ ServerInstance->Exit(EXIT_FAILURE, "A module has invalid configuration");
}
}
if (!PrioritizeHooks())
- ServerInstance->Exit(EXIT_FAILURE);
+ ServerInstance->Exit(EXIT_FAILURE, "Unable to prioritise module hooks", "MODULE");
}
std::string& ModuleManager::LastError()