Skip to content

Commit

Permalink
Rename new marker interfaces
Browse files Browse the repository at this point in the history
TryOnError -> RxDogTagErrorReceiver
DeliverModifiedException -> RxDogTagModifiedExceptionReceiver
  • Loading branch information
ZacSweers committed Aug 20, 2019
1 parent 339fc10 commit 2891fb2
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onSubscribe(Disposable d) {
@Override
public void onError(Throwable e) {
if (delegate instanceof RxDogTagErrorReceiver) {
if (delegate instanceof RxDogTagModifiedExceptionReceiver) {
if (delegate instanceof RxDogTagTaggedExceptionReceiver) {
delegate.onError(createException(config, t, e, null));
} else if (config.guardObserverCallbacks) {
guardedDelegateCall(e2 -> reportError(config, t, e2, "onError"), () -> delegate.onError(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onSuccess(T t) {
@Override
public void onError(Throwable e) {
if (delegate instanceof RxDogTagErrorReceiver) {
if (delegate instanceof RxDogTagModifiedExceptionReceiver) {
if (delegate instanceof RxDogTagTaggedExceptionReceiver) {
delegate.onError(createException(config, t, e, null));
} else if (config.guardObserverCallbacks) {
guardedDelegateCall(e2 -> reportError(config, t, e2, "onError"), () -> delegate.onError(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void onNext(T t) {
@Override
public void onError(Throwable e) {
if (delegate instanceof RxDogTagErrorReceiver) {
if (delegate instanceof RxDogTagModifiedExceptionReceiver) {
if (delegate instanceof RxDogTagTaggedExceptionReceiver) {
delegate.onError(createException(config, t, e, null));
} else if (config.guardObserverCallbacks) {
guardedDelegateCall(e2 -> reportError(config, t, e2, "onError"), () -> delegate.onError(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onSuccess(T t) {
@Override
public void onError(Throwable e) {
if (delegate instanceof RxDogTagErrorReceiver) {
if (delegate instanceof RxDogTagModifiedExceptionReceiver) {
if (delegate instanceof RxDogTagTaggedExceptionReceiver) {
delegate.onError(createException(config, t, e, null));
} else if (config.guardObserverCallbacks) {
guardedDelegateCall(e2 -> reportError(config, t, e2, "onError"), () -> delegate.onError(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void onNext(T t) {
@Override
public void onError(Throwable e) {
if (delegate instanceof RxDogTagErrorReceiver) {
if (delegate instanceof RxDogTagModifiedExceptionReceiver) {
if (delegate instanceof RxDogTagTaggedExceptionReceiver) {
delegate.onError(createException(config, t, e, null));
} else if (config.guardObserverCallbacks) {
guardedDelegateCall(e2 -> reportError(config, t, e2, "onError"), () -> delegate.onError(e));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.uber.rxdogtag;

import io.reactivex.exceptions.OnErrorNotImplementedException;

/**
* A marker type to indicate that RxDogTag's should pass the decorated stacktrace to
* {@link #onError(Throwable)}. Note that this will always be tried directly, and no guarded
* delegate behavior will be attempted even if
* {@link RxDogTag.Builder#guardObserverCallbacks(boolean)} is enabled in configuration.
*
* <p><em>NOTE:</em> RxDogTag exceptions are always
* {@link OnErrorNotImplementedException OnErrorNotImplementedExceptions}, as these have special
* behavior as an escape hatch in RxJava internals. This exception will have no "cause" property if
* the original exception was not already an {@link OnErrorNotImplementedException}. If it was,
* which is unusual, it is reused with its original cause (if any) and has its stacktrace modified.
*/
public interface RxDogTagTaggedExceptionReceiver extends RxDogTagErrorReceiver {

}

0 comments on commit 2891fb2

Please sign in to comment.