reactor-core/src/main/java/reactor/core/publisher/Flux.java
public static <O> Flux<O> error(Throwable throwable, boolean whenRequested) {
		if (whenRequested) {
			return onAssembly(new FluxErrorOnRequest<>(throwable));
		}
		else {
			return onAssembly(new FluxError<>(throwable));
		}
	}
public static <O> Flux<O> error(Throwable throwable, boolean whenRequested) {
		if (whenRequested) {
			return onAssembly(new FluxErrorOnRequest<>(throwable));
		}
		else {
			return onAssembly(new FluxError<>(throwable));
		}
	}
Create a {@link Flux} that terminates with the specified error, either immediately
after being subscribed to or after being first requested.

<p>
<img class="marble" src="doc-files/marbles/errorWhenRequested.svg" alt="">

@param throwable the error to signal to each {@link Subscriber}
@param whenRequested if true, will onError on the first request instead of subscribe().
@param <O> the reified type of the target {@link Subscriber}

@return a new failing {@link Flux}