Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
print-options.hh File Reference

Options for printing Nix values. More...

#include <limits>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  nix::PrintOptions
 

Enumerations

enum class  nix::ErrorPrintBehavior { Print , Throw , ThrowTopLevel }
 

Detailed Description

Options for printing Nix values.

Enumeration Type Documentation

◆ ErrorPrintBehavior

enum class nix::ErrorPrintBehavior
strong

How errors should be handled when printing values.

Enumerator
Print 

Print the first line of the error in brackets: «error: oh no!»

Throw 

Throw the error to the code that attempted to print the value, instead of suppressing it it.

ThrowTopLevel 

Only throw the error if encountered at the top level of the expression.

This will cause expressions like builtins.throw "uh oh!" to throw errors, but will print attribute sets and other nested structures containing values that error (like nixpkgs) normally.