diff options
| author | Dan Engelbrecht <[email protected]> | 2024-04-04 14:32:40 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-04-04 14:32:40 +0200 |
| commit | 12b7bf1c16f671c83840961c37a339141a7ffbb3 (patch) | |
| tree | 3c503e6e1cd4d53b87c1baebcf9286ca8b72db06 /src/zenserver/upstream/upstreamcache.cpp | |
| parent | hardening parsepackagemessage (#38) (diff) | |
| download | zen-12b7bf1c16f671c83840961c37a339141a7ffbb3.tar.xz zen-12b7bf1c16f671c83840961c37a339141a7ffbb3.zip | |
improved assert (#37)
- Improvement: Add file and line to ASSERT exceptions
- Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller
Diffstat (limited to 'src/zenserver/upstream/upstreamcache.cpp')
| -rw-r--r-- | src/zenserver/upstream/upstreamcache.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/zenserver/upstream/upstreamcache.cpp b/src/zenserver/upstream/upstreamcache.cpp index dac29c273..6d1d026cc 100644 --- a/src/zenserver/upstream/upstreamcache.cpp +++ b/src/zenserver/upstream/upstreamcache.cpp @@ -152,7 +152,7 @@ namespace detail { return m_Status.EndpointStatus(); } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -292,7 +292,7 @@ namespace detail { return {.Status = {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)}}}; } } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -388,7 +388,7 @@ namespace detail { return {.Status = {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)}}}; } } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -615,7 +615,7 @@ namespace detail { }); } } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -825,7 +825,7 @@ namespace detail { return m_Status.EndpointStatus(); } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -861,7 +861,7 @@ namespace detail { return {.Status = {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)}}}; } } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -984,7 +984,7 @@ namespace detail { return {.Status = {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)}}}; } } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -1405,7 +1405,7 @@ namespace detail { .ElapsedSeconds = TotalElapsedSeconds, .Success = Result.Success}; } - catch (std::exception& Err) + catch (const std::exception& Err) { m_Status.Set(UpstreamEndpointState::kError, Err.what()); @@ -1980,7 +1980,7 @@ private: { ProcessCacheRecord(std::move(CacheRecord)); } - catch (std::exception& Err) + catch (const std::exception& Err) { ZEN_ERROR("upload cache record '{}/{}/{}' FAILED, reason '{}'", CacheRecord.Namespace, @@ -2052,7 +2052,7 @@ private: } } } - catch (std::exception& Err) + catch (const std::exception& Err) { ZEN_ERROR("check endpoint(s) health FAILED, reason '{}'", Err.what()); } |