> For the complete documentation index, see [llms.txt](https://soufatn.gitbook.io/rxjs-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soufatn.gitbook.io/rxjs-book/summary/observable/observable_instance_methods/doonerror.md).

# doOnError | tapOnError

Invokes an action upon exceptional termination of the observable sequence.

This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.

## Arguments

1. `onError` *(`Function`)*: Function to invoke upon exceptional termination of the observable sequence.
2. \[`thisArg`] *(Any)*: Object to use as this when executing callback.

## Returns

*(`Observable`)*: The source sequence with the side-effecting behavior applied.

## Example

### Using a function

### Using a thisArg
