summary refs log tree commit diff
path: root/pkgs/lib/debug.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/debug.nix')
-rw-r--r--pkgs/lib/debug.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/lib/debug.nix b/pkgs/lib/debug.nix
new file mode 100644
index 00000000000..23d1a85c72f
--- /dev/null
+++ b/pkgs/lib/debug.nix
@@ -0,0 +1,15 @@
+rec {
+
+
+  # Wrapper aroung the primop `addErrorContext', which shouldn't used
+  # directly.  It evaluates and returns `val', but if an evaluation
+  # error occurs, the text in `msg' is added to the error context
+  # (stack trace) printed by Nix.
+  addErrorContext =
+    if builtins ? addErrorContext
+    then builtins.addErrorContext
+    else msg: val: val;
+
+
+
+}
\ No newline at end of file