# Consistently use \`context\(\)\` to preserve sources for anyhow errors \(\#59112\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2ab35c6b7d594288cdfee6695d1afa8f7ce91444)

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

Visibility: public

Requested revision: 2ab35c6b7d594288cdfee6695d1afa8f7ce91444

Requested commit: 2ab35c6b7d594288cdfee6695d1afa8f7ce91444

Commit: 2ab35c6b7d594288cdfee6695d1afa8f7ce91444

Tree: 13da15b217bd3c1faebef6013bae663270d83813

Author: Tom Houlé

Committer: GitHub

## Message

```
Consistently use `context()` to preserve sources for anyhow errors (#59112)

When you use `anyhow::anyhow!("{error}")` to convert a preexisting error
to an `anyhow::Error`, the error source can be lost (depending on the
`Display` impl of the error). Anyhow errors can display the whole source
chain when printed. This commit makes us consistently use `context()`
instead to preserve the underlying error's source.

Release Notes:

- N/A
```

## Parents

- [bc3c9422f4b29cdafd64fc89853b8705a359a0e7](https://git.cafe/gitcafe/zed/commit/bc3c9422f4b29cdafd64fc89853b8705a359a0e7?format=markdown)

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