# Trait HttpSoft\ErrorHandler\ErrorHandlerTrait

Trait containing methods for handling errors, used within HttpSoft\ErrorHandler\ErrorHandler and HttpSoft\ErrorHandler\ErrorHandlerMiddleware.

Source code on GitHub.

# Public methods

# addListener

Adds an error listener to the queue that will trigger if an error occurs.

public function addListener(ErrorListenerInterface $listener): void;

If you re-add an instance of the same class that implements HttpSoft\ErrorHandler\ErrorListenerInterface, the first one will simply be overwritten and keep its place in the queue.