diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-08 04:49:08 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-09 00:05:41 -0700 |
commit | 87e6ac5eb706593d15d29b070eac5f05e305a787 (patch) | |
tree | 79062f2ab0e8a298de9b68419fa4094994e26e22 /src/libexpr/print-options.hh | |
parent | 896e525681bbf696c330af4e51c5e161d3818350 (diff) |
Merge pull request #9753 from 9999years/print-value-on-type-error
Print the value in `value is X while a Y is expected` error
(cherry picked from commit 5f72a97092da6af28a7d2b2a50d74e9d34fae7e1)
Change-Id: Idb4bc903ae59a0f5b6fb3b1da4d47970fe0a6efe
Diffstat (limited to 'src/libexpr/print-options.hh')
-rw-r--r-- | src/libexpr/print-options.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libexpr/print-options.hh b/src/libexpr/print-options.hh index 11ff9ae87..aba2eaeae 100644 --- a/src/libexpr/print-options.hh +++ b/src/libexpr/print-options.hh @@ -49,4 +49,16 @@ struct PrintOptions size_t maxStringLength = std::numeric_limits<size_t>::max(); }; +/** + * `PrintOptions` for unknown and therefore potentially large values in error messages, + * to avoid printing "too much" output. + */ +static PrintOptions errorPrintOptions = PrintOptions { + .ansiColors = true, + .maxDepth = 10, + .maxAttrs = 10, + .maxListItems = 10, + .maxStringLength = 1024 +}; + } |