aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.hh
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-04-29 18:57:05 -0600
committerBen Burdette <bburdette@gmail.com>2020-04-29 18:57:05 -0600
commit39ff80d031c5c9c1831ba5ea597c0de0181bfe34 (patch)
tree8a52bc4f5a42040ef8fd09b20e88b3bcaf30cc05 /src/libutil/error.hh
parent2d0f766a778ac790be1ab1918db7c319ac7e5792 (diff)
errorinfo constructor test
Diffstat (limited to 'src/libutil/error.hh')
-rw-r--r--src/libutil/error.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index 03e43241f..48e6311bd 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -83,6 +83,7 @@ class BaseError : public std::exception
protected:
string prefix_; // used for location traces etc.
ErrorInfo err;
+
std::optional<string> what_;
const string& calcWhat()
{
@@ -107,18 +108,18 @@ public:
.hint = hintfmt(args...)
}
, status(status)
- { }
+ { }
template<typename... Args>
BaseError(const Args & ... args)
: err { .level = lvlError,
.hint = hintfmt(args...)
}
- { }
+ { }
BaseError(ErrorInfo e)
: err(e)
- { }
+ { }
virtual const char* sname() const { return "BaseError"; }