aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-08-08 14:36:47 +0200
committerGitHub <[email protected]>2023-08-08 14:36:47 +0200
commit9bd00e05b31e2ddb709b2afbc8569b7e4d767745 (patch)
tree382447f15b735c57cf0445e496f7c8943f83249d /src/zenserver/zenserver.cpp
parent0.2.14 (diff)
downloadzen-9bd00e05b31e2ddb709b2afbc8569b7e4d767745.tar.xz
zen-9bd00e05b31e2ddb709b2afbc8569b7e4d767745.zip
fix asserts and exceptions (#344)
* Send proper error to caller of GetChunkInfo instead of assert * catch and handle exceptions when checking for state_marker * properly wait for background tasks if oplop-export fails * changelog
Diffstat (limited to 'src/zenserver/zenserver.cpp')
-rw-r--r--src/zenserver/zenserver.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 6ce49b1fe..6e636611d 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -571,9 +571,18 @@ public:
void CheckStateMarker()
{
std::filesystem::path StateMarkerPath = m_DataRoot / "state_marker";
- if (!std::filesystem::exists(StateMarkerPath))
+ try
+ {
+ if (!std::filesystem::exists(StateMarkerPath))
+ {
+ ZEN_WARN("state marker at {} has been deleted, exiting", StateMarkerPath);
+ RequestExit(1);
+ return;
+ }
+ }
+ catch (std::exception& Ex)
{
- ZEN_WARN("state marker at {} has been deleted, exiting", StateMarkerPath);
+ ZEN_WARN("state marker at {} could not be checked, reason: '{}'", StateMarkerPath, Ex.what());
RequestExit(1);
return;
}