aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.hh
AgeCommit message (Collapse)Author
2022-04-29spacingBen Burdette
2022-04-28Merge branch 'master' into debug-merge-masterBen Burdette
2022-04-21don't use Symbol in Pos to represent a pathpennae
PosTable deduplicates origin information, so using symbols for paths is no longer necessary. moving away from path Symbols also reduces the usage of symbols for things that are not keys in attribute sets, which will become important in the future when we turn symbols into indices as well.
2022-04-15Merge branch 'master' into debug-exploratory-PRBen Burdette
2022-04-08Error: Remove unused sname() methodEelco Dolstra
2022-04-08Remove unused Error.name fieldEelco Dolstra
2022-04-07Merge remote-tracking branch 'upstream/master' into upstream-mergeBen Burdette
2022-03-30libutil: Change return value of addTrace to voidDaniel Pauls
The return value of BaseError::addTrace(...) is never used and error-prone as subclasses calling it will return a BaseError instead of the subclass. This commit changes its return value to be void.
2022-03-11Merge pull request #5865 from pennae/memory-friendlinessEelco Dolstra
be more memory friendly
2022-03-08make Pos smallerpennae
reduces peak hep memory use on eval of our test system from 264.4MB to 242.3MB, possibly also a slight performance boost. theoretically memory use could be cut down by another eight bytes per Pos on average by turning it into a tuple containing an index into a global base position table with row and column offsets, but that doesn't seem worth the effort at this point.
2022-03-07Implement a suggestions mechanismregnat
Each `Error` class now includes a set of suggestions, and these are printed by the top-level handler.
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2022-02-04Merge branch 'master' into debug-stepBen Burdette
2022-01-17serialise.hh: Use std::string_viewEelco Dolstra
2021-12-22stack traces basically workingBen Burdette
2021-09-13printEnvPosChainBen Burdette
2021-01-21Improve error formattingEelco Dolstra
Changes: * The divider lines are gone. These were in practice a bit confusing, in particular with --show-trace or --keep-going, since then there were multiple lines, suggesting a start/end which wasn't the case. * Instead, multi-line error messages are now indented to align with the prefix (e.g. "error: "). * The 'description' field is gone since we weren't really using it. * 'hint' is renamed to 'msg' since it really wasn't a hint. * The error is now printed *before* the location info. * The 'name' field is no longer printed since most of the time it wasn't very useful since it was just the name of the exception (like EvalError). Ideally in the future this would be a unique, easily googleable error ID (like rustc). * "trace:" is now just "…". This assumes error contexts start with something like "while doing X". Example before: error: --- AssertionError ---------------------------------------------------------------------------------------- nix at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix 6| 7| x = assert false; 1; | ^ 8| assertion 'false' failed ----------------------------------------------------- show-trace ----------------------------------------------------- trace: while evaluating the attribute 'x' of the derivation 'hello-2.10' at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix 191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) { 192| name = "${attrs.pname}-${attrs.version}"; | ^ 193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) { Example after: error: assertion 'false' failed at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix 6| 7| x = assert false; 1; | ^ 8| … while evaluating the attribute 'x' of the derivation 'hello-2.10' at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix 191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) { 192| name = "${attrs.pname}-${attrs.version}"; | ^ 193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
2021-01-15Merge pull request #4240 from bburdette/2259-error-messageDomen Kožar
2259 error message - "auto-call" error
2020-12-10Add lvlNotice log levelEelco Dolstra
This is like syslog's LOG_NOTICE: "normal, but significant, condition".
2020-11-11usage example locationBen Burdette
2020-10-07FormattingEelco Dolstra
2020-07-20Add UnimplementedError to ease grepping for theseCarlo Nucera
2020-07-07Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-07Fix coverage buildEelco Dolstra
2020-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-30comments and cleanupBen Burdette
2020-06-30Merge branch 'master' into add-traceBen Burdette
2020-06-30check for a null symbolBen Burdette
2020-06-27showtrace as function argBen Burdette
2020-06-25showTrace flag for ErrorInfo; showTrace test.Ben Burdette
2020-06-24add trace test; error formatting refinementsBen Burdette
2020-06-24convenience form of addTraceBen Burdette
2020-06-24repl indentingBen Burdette
2020-06-24nixCode -> LinesOfCodeBen Burdette
2020-06-23use plain errPos instead of nixCode; fix testsBen Burdette
2020-06-19addErrorTraceBen Burdette
2020-06-18addTraceBen Burdette
2020-06-18Merge branch 'master' into caveman-LOCsBen Burdette
2020-06-17Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-15Add mising #include for strerrorJohn Ericson
2020-06-15Get rid of explicit ErrorInfo constructorsEelco Dolstra
2020-06-08Merge branch 'errors-phase-2' into caveman-LOCsBen Burdette
2020-06-04add some commentsBen Burdette
2020-06-02remove extra space in SysErrorsBen Burdette
2020-05-20print LOC for stdin, string argsBen Burdette
2020-05-14fix compile errorsBen Burdette
2020-05-11fixes to merged codeBen Burdette
2020-05-08add pos to errorinfo, remove from hintsBen Burdette
2020-05-07pretending to be constBen Burdette
2020-05-06implement SysError errno handlingBen Burdette