Skip to content

Commit 51cee6d

Browse files
committed
Add rl-next/c-api-recoverable-errors
1 parent d106076 commit 51cee6d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
synopsis: "C API: Errors returned from your primops are not treated as recoverable by default"
3+
prs: [13930]
4+
---
5+
6+
Nix 2.32 by default remembers the error in the thunk that triggered it.
7+
8+
Previously the following sequence of events worked:
9+
10+
1. Have a thunk that invokes a primop that's defined through the C API
11+
2. The primop returns an error
12+
3. Force the thunk again
13+
4. The primop returns a value
14+
5. The thunk evaluated successfully
15+
16+
**Resolution**
17+
18+
C API consumers that rely on this must change their recoverable error calls:
19+
20+
```diff
21+
-nix_set_err_msg(context, NIX_ERR_*, msg);
22+
+nix_set_err_msg(context, NIX_ERR_RECOVERABLE, msg);
23+
```

0 commit comments

Comments
 (0)