# IAsyncObserver&lt;T&gt;.OnErrorAsync(Exception)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.iasyncobserver-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.iasyncobserver-1/methods/)

```csharp
public abstract Task OnErrorAsync(Exception ex)
```

Notifies the consumer that the stream had an error. 

The Task returned from this method should be completed when the consumer is done processing the stream closure.

### Parameters

- `ex` (`Exception`): An Exception that describes the error that occurred on the stream.

### Returns

A Task that is completed when the close has been accepted.
