aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore/projectstore.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/projectstore/projectstore.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/projectstore/projectstore.cpp')
-rw-r--r--src/zenserver/projectstore/projectstore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 184376c39..ae6f0d1d8 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -1952,7 +1952,11 @@ ProjectStore::GetChunkInfo(const std::string_view ProjectId,
IoHash RawHash;
uint64_t RawSize;
bool IsCompressed = CompressedBuffer::ValidateCompressedHeader(Chunk, RawHash, RawSize);
- ZEN_ASSERT(IsCompressed);
+ if (!IsCompressed)
+ {
+ return {HttpResponseCode::InternalServerError,
+ fmt::format("Chunk info request for malformed chunk id '{}/{}'/'{}'", ProjectId, OplogId, ChunkId)};
+ }
ChunkSize = RawSize;
}