|
49 | 49 | */
|
50 | 50 | public final class RxJavaPlugins {
|
51 | 51 | @Nullable
|
52 |
| - static volatile Consumer<Throwable> errorHandler; |
| 52 | + static volatile Consumer<? super Throwable> errorHandler; |
53 | 53 |
|
54 | 54 | @Nullable
|
55 | 55 | static volatile Function<Runnable, Runnable> onScheduleHandler;
|
@@ -197,7 +197,7 @@ public static Function<Scheduler, Scheduler> getComputationSchedulerHandler() {
|
197 | 197 | * @return the hook consumer, may be null
|
198 | 198 | */
|
199 | 199 | @Nullable
|
200 |
| - public static Consumer<Throwable> getErrorHandler() { |
| 200 | + public static Consumer<? super Throwable> getErrorHandler() { |
201 | 201 | return errorHandler;
|
202 | 202 | }
|
203 | 203 |
|
@@ -356,7 +356,7 @@ public static Scheduler onComputationScheduler(@NonNull Scheduler defaultSchedul
|
356 | 356 | * @param error the error to report
|
357 | 357 | */
|
358 | 358 | public static void onError(@NonNull Throwable error) {
|
359 |
| - Consumer<Throwable> f = errorHandler; |
| 359 | + Consumer<? super Throwable> f = errorHandler; |
360 | 360 |
|
361 | 361 | if (error == null) {
|
362 | 362 | error = new NullPointerException("onError called with null. Null values are generally not allowed in 2.x operators and sources.");
|
@@ -497,7 +497,7 @@ public static void setComputationSchedulerHandler(@Nullable Function<Scheduler,
|
497 | 497 | * Sets the specific hook function.
|
498 | 498 | * @param handler the hook function to set, null allowed
|
499 | 499 | */
|
500 |
| - public static void setErrorHandler(@Nullable Consumer<Throwable> handler) { |
| 500 | + public static void setErrorHandler(@Nullable Consumer<? super Throwable> handler) { |
501 | 501 | if (lockdown) {
|
502 | 502 | throw new IllegalStateException("Plugins can't be changed anymore");
|
503 | 503 | }
|
|
0 commit comments