From d29b3ccba64944c9aa2ec3d08079170d47f9c4db Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 15 Sep 2021 21:31:39 +0200 Subject: Added more context to missing chunk exceptions --- zenserver/compute/apply.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'zenserver/compute/apply.cpp') diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp index c3d83b2b5..7b76bb80b 100644 --- a/zenserver/compute/apply.cpp +++ b/zenserver/compute/apply.cpp @@ -647,6 +647,7 @@ CbPackage HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) { using namespace std::literals; + using namespace fmt::literals; std::filesystem::path SandboxPath = CreateNewSandbox(); @@ -667,7 +668,7 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) if (!DataBuffer) { - throw std::runtime_error("Chunk missing" /* ADD CONTEXT */); + throw std::runtime_error("worker CAS chunk '{}' missing"_format(Hash)); } zen::WriteFile(FilePath, DataBuffer); @@ -693,7 +694,7 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) if (!DataBuffer) { - throw std::runtime_error("Chunk missing" /* ADD CONTEXT */); + throw std::runtime_error("worker CAS chunk '{}' missing"_format(Hash)); } zen::WriteFile(FilePath, DataBuffer); @@ -712,7 +713,7 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) if (!DataBuffer) { - throw std::runtime_error("Chunk missing" /* ADD CONTEXT */); + throw std::runtime_error("input CID chunk '{}' missing"_format(Cid)); } zen::WriteFile(FilePath, DataBuffer); -- cgit v1.2.3