Callback that is used when a stream emits an error and no error listener is attached. Used to store the error and start the logger timer.
Makes sure that listeners always receive the error event of a stream, even if it was thrown before the listener was attached. If the input is already guarded nothing will happen.
Stream that can potentially throw an error.
The wrapped stream.
Callback that is used when a new listener is attached to remove the current error-related fallback functions, or to emit an error if one was thrown in the meantime.
A stream that is guarded. This means that if this stream emits an error before a listener is attached, it will store the error and emit it once a listener is added.