aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil')
-rw-r--r--src/zenutil/include/zenutil/parallellwork.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/zenutil/include/zenutil/parallellwork.h b/src/zenutil/include/zenutil/parallellwork.h
index 79798fc8d..8ea77c65d 100644
--- a/src/zenutil/include/zenutil/parallellwork.h
+++ b/src/zenutil/include/zenutil/parallellwork.h
@@ -9,6 +9,14 @@
#include <atomic>
+class ParallellWorkException : public std::runtime_error
+{
+public:
+ explicit ParallellWorkException(std::vector<std::string>&& Errors) : std::runtime_error(Errors.front()), m_Errors(std::move(Errors)) {}
+
+ const std::vector<std::string> m_Errors;
+};
+
namespace zen {
class ParallellWork
@@ -95,13 +103,7 @@ public:
}
else if (m_Errors.size() > 1)
{
- ExtendableStringBuilder<128> SB;
- SB.Append("Multiple errors:");
- for (const std::string& Error : m_Errors)
- {
- SB.Append(fmt::format("\n {}", Error));
- }
- throw std::runtime_error(SB.ToString());
+ throw ParallellWorkException(std::move(m_Errors));
}
}
Latch& PendingWork() { return m_PendingWork; }