mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
rename errors/warnings
This commit is contained in:
parent
09652f597c
commit
9e7b89bf10
2 changed files with 8 additions and 32 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue