aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.hh
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-05-08 18:18:28 -0600
committerBen Burdette <bburdette@gmail.com>2020-05-08 18:18:28 -0600
commit55eb71714854b262b5e1079ff250a13cc0bbf644 (patch)
tree576767e919ac461b15ce11671a285d3933e15129 /src/libutil/error.hh
parent1b801cec407454b904466153dfc56cec6b433f4b (diff)
add pos to errorinfo, remove from hints
Diffstat (limited to 'src/libutil/error.hh')
-rw-r--r--src/libutil/error.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index 19a806cc1..7e2cca2f9 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -35,10 +35,15 @@ typedef enum {
} Verbosity;
struct ErrPos {
- int line;
- int column;
+ int line = 0;
+ int column = 0;
string file;
+ operator bool() const
+ {
+ return line != 0;
+ }
+
template <class P>
ErrPos& operator=(const P &pos)
{
@@ -58,7 +63,7 @@ struct ErrPos {
struct NixCode {
ErrPos errPos;
std::optional<string> prevLineOfCode;
- string errLineOfCode;
+ std::optional<string> errLineOfCode;
std::optional<string> nextLineOfCode;
};