# Simplify error management in stream_completion \(\#43035\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 898c133906f6904f8f1d99650a2e23e300a4dd1d

Requested commit: 898c133906f6904f8f1d99650a2e23e300a4dd1d

Commit: 898c133906f6904f8f1d99650a2e23e300a4dd1d

Tree: eca393b18ed994d697bbf6c0528b71f6c4fbff28

Author: Mikayla Maki

Committer: GitHub

## Message

```
Simplify error management in stream_completion (#43035)

This PR simplifies error and event handling by removing the
`Ok(LanguageModelCompletionEvent::Status(CompletionRequestStatus::Failed)))`
state from the stream returned by `LanguageModel::stream_completion()`,
by changing it into an `Err(LanguageModelCompletionError)`. This was
done by collapsing the valid `CompletionRequestStatus` values into
`LanguageModelCompletionEvent`.

Release Notes:

- N/A

---------

Co-authored-by: Michael Benfield <mbenfield@zed.dev>
```

## Parents

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

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