diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-01-18 01:19:07 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-01-18 01:34:07 +0100 |
commit | 9b33ef3879a764bed4cc2404a08344c3a697a646 (patch) | |
tree | d6921123c18a9077d2f897999e3a1445d1738502 /src/libutil/error.hh | |
parent | 98f57f44bbeca3b555bd732771eac4c07d54576b (diff) |
Revert "Merge pull request #6204 from layus/coerce-string"
This reverts commit a75b7ba30f1e4f8b15e810fd18e63ee9552e0815, reversing
changes made to 9af16c5f742300e831a2cc400e43df1e22f87f31.
Diffstat (limited to 'src/libutil/error.hh')
-rw-r--r-- | src/libutil/error.hh | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh index 7d236028c..c3bb8c0df 100644 --- a/src/libutil/error.hh +++ b/src/libutil/error.hh @@ -86,7 +86,6 @@ void printCodeLines(std::ostream & out, struct Trace { std::shared_ptr<AbstractPos> pos; hintformat hint; - bool frame; }; struct ErrorInfo { @@ -115,8 +114,6 @@ protected: public: unsigned int status = 1; // exit status - BaseError(const BaseError &) = default; - template<typename... Args> BaseError(unsigned int status, const Args & ... args) : err { .level = lvlError, .msg = hintfmt(args...) } @@ -155,22 +152,15 @@ public: const std::string & msg() const { return calcWhat(); } const ErrorInfo & info() const { calcWhat(); return err; } - void pushTrace(Trace trace) - { - err.traces.push_front(trace); - } - template<typename... Args> - void addTrace(std::shared_ptr<AbstractPos> && e, std::string_view fs, const Args & ... args) + void addTrace(std::shared_ptr<AbstractPos> && e, const std::string & fs, const Args & ... args) { - addTrace(std::move(e), hintfmt(std::string(fs), args...)); + addTrace(std::move(e), hintfmt(fs, args...)); } - void addTrace(std::shared_ptr<AbstractPos> && e, hintformat hint, bool frame = false); + void addTrace(std::shared_ptr<AbstractPos> && e, hintformat hint); bool hasTrace() const { return !err.traces.empty(); } - - const ErrorInfo & info() { return err; }; }; #define MakeError(newClass, superClass) \ |