diff options
author | Daniel Pauls <daniel1708.de+git@gmail.com> | 2022-03-30 17:30:47 +0200 |
---|---|---|
committer | Daniel Pauls <daniel1708.de+git@gmail.com> | 2022-03-30 18:37:32 +0200 |
commit | 629edd43ba7550be835660fe5df3b65cc4a515c7 (patch) | |
tree | 159ecbcb402a38d2d0f8c46bddbbfc7034bc5548 /src/libutil/error.hh | |
parent | fa83b865a2cfd21d7e63eedb206c1e07c8178965 (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.hh')
-rw-r--r-- | src/libutil/error.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh index 93b789f0b..6a757f9ad 100644 --- a/src/libutil/error.hh +++ b/src/libutil/error.hh @@ -175,12 +175,12 @@ public: const ErrorInfo & info() const { calcWhat(); return err; } template<typename... Args> - BaseError & addTrace(std::optional<ErrPos> e, const std::string & fs, const Args & ... args) + void addTrace(std::optional<ErrPos> e, const std::string & fs, const Args & ... args) { - return addTrace(e, hintfmt(fs, args...)); + addTrace(e, hintfmt(fs, args...)); } - BaseError & addTrace(std::optional<ErrPos> e, hintformat hint); + void addTrace(std::optional<ErrPos> e, hintformat hint); bool hasTrace() const { return !err.traces.empty(); } }; |