# stage2: Propagate error return trace into fn call · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b529d8e48f2082c4e8df10d0ff26e2c7702bb693)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b529d8e48f2082c4e8df10d0ff26e2c7702bb693

Requested commit: b529d8e48f2082c4e8df10d0ff26e2c7702bb693

Commit: b529d8e48f2082c4e8df10d0ff26e2c7702bb693

Tree: 4e38a63b1c75b1ae1db0660c918afa0fedb56bbe

Author: Cody Tapscott

Committer: Cody Tapscott

## Message

```
stage2: Propagate error return trace into fn call

This change extends the "lifetime" of the error return trace associated
with an error to include the duration of a function call it is passed
to.

This means that if a function returns an error, its return trace will
include the error return trace for any error inputs. This is needed to
support `testing.expectError` and similar functions.

If a function returns a non-error, we have to clean up any error return
traces created by error-able call arguments.

```

## Parents

- [77720e30aaead1c814f2714bd5a7ad7ad0fbc23e](https://git.cafe/gitcafe/zig/commit/77720e30aaead1c814f2714bd5a7ad7ad0fbc23e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b529d8e48f2082c4e8df10d0ff26e2c7702bb693?format=markdown)
