aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.cc
diff options
context:
space:
mode:
authorDaniel Pauls <daniel1708.de+git@gmail.com>2022-03-30 17:30:47 +0200
committerDaniel Pauls <daniel1708.de+git@gmail.com>2022-03-30 18:37:32 +0200
commit629edd43ba7550be835660fe5df3b65cc4a515c7 (patch)
tree159ecbcb402a38d2d0f8c46bddbbfc7034bc5548 /src/libutil/error.cc
parentfa83b865a2cfd21d7e63eedb206c1e07c8178965 (diff)
libutil: Change return value of addTrace to void
The return value of BaseError::addTrace(...) is never used and error-prone as subclasses calling it will return a BaseError instead of the subclass. This commit changes its return value to be void.
Diffstat (limited to 'src/libutil/error.cc')
-rw-r--r--src/libutil/error.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index b2dfb35b2..02bc5caa5 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -9,10 +9,9 @@ namespace nix {
const std::string nativeSystem = SYSTEM;
-BaseError & BaseError::addTrace(std::optional<ErrPos> e, hintformat hint)
+void BaseError::addTrace(std::optional<ErrPos> e, hintformat hint)
{
err.traces.push_front(Trace { .pos = e, .hint = hint });
- return *this;
}
// c++ std::exception descendants must have a 'const char* what()' function.