src/main/java/io/reactivex/Notification.java
@NonNull
    public static <T> Notification<T> createOnError(@NonNull Throwable error) {
        ObjectHelper.requireNonNull(error, "error is null");
        return new Notification<T>(NotificationLite.error(error));
    }
@NonNull
    public static <T> Notification<T> createOnError(@NonNull Throwable error) {
        ObjectHelper.requireNonNull(error, "error is null");
        return new Notification<T>(NotificationLite.error(error));
    }
Constructs an onError notification containing the error.
@param <T> the value type
@param error the error Throwable to carry around in the notification, not null
@return the new Notification instance
@throws NullPointerException if error is null