From 9bd00e05b31e2ddb709b2afbc8569b7e4d767745 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 8 Aug 2023 14:36:47 +0200 Subject: 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 --- src/zenserver/projectstore/projectstore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/zenserver/projectstore/projectstore.cpp') 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; } -- cgit v1.2.3