aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-04-24 21:40:13 -0600
committerBen Burdette <bburdette@gmail.com>2020-04-24 21:40:13 -0600
commitcdac083dc54b65f66f88caf193c617c1dbf3bbd6 (patch)
tree6ac150250e1987d239770536c2da453607e33ec0 /src/libutil/error.cc
parentd8d4844b883dcea67cccb9bd75eecb14e60ae496 (diff)
don't print blank lines for blank description
Diffstat (limited to 'src/libutil/error.cc')
-rw-r--r--src/libutil/error.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index 20b97ea3d..c800fe9a8 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -88,7 +88,7 @@ void printCodeLines(const string &prefix, const NixCode &nixCode)
std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
{
int errwidth = 80;
- string prefix = " ";
+ string prefix = "";
string levelString;
switch (einfo.level) {
@@ -176,8 +176,10 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
}
// description
- out << prefix << einfo.description << std::endl;
- out << prefix << std::endl;
+ if (einfo.description != "") {
+ out << prefix << einfo.description << std::endl;
+ out << prefix << std::endl;
+ }
// lines of code.
if (einfo.nixCode.has_value() && einfo.nixCode->errLineOfCode != "") {