From 9e7b89bf100500cf252f785e2dd77f83ee5cf7a4 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Tue, 31 Mar 2020 11:56:37 -0600 Subject: [PATCH] rename errors/warnings --- src/libutil/error.hh | 8 ++++---- tests/errors/main.cc | 32 ++++---------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/src/libutil/error.hh b/src/libutil/error.hh index 1acc70d9d..cd2b2832d 100644 --- a/src/libutil/error.hh +++ b/src/libutil/error.hh @@ -256,11 +256,11 @@ class AddHint : private T typedef AddName< AddDescription< AddHint< - EIError>>> StandardError; + EIError>>> ProgramError; typedef AddName< AddDescription< AddHint< - EIWarning>>> StandardWarning; + EIWarning>>> ProgramWarning; typedef AddName< AddDescription< @@ -269,7 +269,7 @@ typedef AddName< AddColumnRange< AddLOC< AddHint< - EIError>>>>>>> MkNixError; + EIError>>>>>>> NixLangError; typedef AddName< AddDescription< AddNixFile< @@ -277,7 +277,7 @@ typedef AddName< AddColumnRange< AddLOC< AddHint< - EIWarning>>>>>>> MkNixWarning; + EIWarning>>>>>>> NixLangWarning; // -------------------------------------------------------- diff --git a/tests/errors/main.cc b/tests/errors/main.cc index ffce334b7..101d44a7e 100644 --- a/tests/errors/main.cc +++ b/tests/errors/main.cc @@ -14,44 +14,20 @@ int main() ErrorInfo::programName = optional("error-test"); - /* - ColumnRange columnRange; - columnRange.start = 24; - columnRange.len = 14; - - ErrLine errline; - errline.lineNumber = 7; - errline.columnRange = optional(columnRange); - errline.errLineOfCode = "line of code where the error occurred"; - - NixCode nixcode; - nixcode.nixFile = optional("myfile.nix"); - nixcode.errLine = errline; - - ErrorInfo generic; - generic.level = elError; - generic.name = "error name"; - generic.description = "general error description"; - generic.program = "nixtool.exe"; - generic.nixCode = nixcode; - - printErrorInfo(generic); - */ - - printErrorInfo(StandardError() + printErrorInfo(ProgramError() .name("name") .description("error description") .nohint() ); - printErrorInfo(StandardWarning() + printErrorInfo(ProgramWarning() .name("warning name") .description("warning description") .nohint() ); - printErrorInfo(MkNixWarning() + printErrorInfo(NixLangWarning() .name("warning name") .description("warning description") .nixFile("myfile.nix") @@ -63,7 +39,7 @@ int main() .hint(hintfmt("this hint has %1% templated %2%!!") % "yellow" % "values") ); - printErrorInfo(MkNixError() + printErrorInfo(NixLangError() .name("error name") .description("error description") .nixFile("myfile.nix")