mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Improve error handling of map database creation
This commit is contained in:
parent
7abaa8d4cd
commit
d54646d342
7 changed files with 71 additions and 32 deletions
|
@ -473,8 +473,15 @@ void Server::init()
|
|||
EnvAutoLock envlock(this);
|
||||
|
||||
// Create the Map (loads map_meta.txt, overriding configured mapgen params)
|
||||
auto startup_server_map = std::make_unique<ServerMap>(m_path_world, this,
|
||||
m_emerge.get(), m_metrics_backend.get());
|
||||
std::unique_ptr<ServerMap> startup_server_map;
|
||||
try {
|
||||
startup_server_map = std::make_unique<ServerMap>(m_path_world, this,
|
||||
m_emerge.get(), m_metrics_backend.get());
|
||||
} catch (DatabaseException &e) {
|
||||
throw ServerError(std::string(
|
||||
"Failed to initialize the map database. The world may be "
|
||||
"corrupted or in an unsupported format.\n") + e.what());
|
||||
}
|
||||
|
||||
// Initialize scripting
|
||||
infostream << "Server: Initializing Lua" << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue