diff options
| author | Dan Engelbrecht <[email protected]> | 2025-03-18 19:33:28 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2025-03-18 19:33:28 +0100 |
| commit | 9debdcada68980e73b3d76681be3cef0cc937edd (patch) | |
| tree | c9bc6d0ca3cd3c3c5d0b943e00e2312e742c90a6 /src/zenutil/include | |
| parent | Merge remote-tracking branch 'origin/main' into sb/build-cache (diff) | |
| parent | improved reporting on async error (#312) (diff) | |
| download | zen-sb/build-cache.tar.xz zen-sb/build-cache.zip | |
Merge remote-tracking branch 'origin/main' into sb/build-cachesb/build-cache
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/parallellwork.h | 16 |
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; } |