本文整理匯總了Java中rx.exceptions.Exceptions.throwIfFatal方法的典型用法代碼示例。如果您正苦於以下問題:Java Exceptions.throwIfFatal方法的具體用法?Java Exceptions.throwIfFatal怎麽用?Java Exceptions.throwIfFatal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rx.exceptions.Exceptions
的用法示例。
在下文中一共展示了Exceptions.throwIfFatal方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onNext
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Override public void onNext(Response<R> response) {
if (response.isSuccessful()) {
subscriber.onNext(response.body());
} else {
subscriberTerminated = true;
Throwable t = new HttpException(response);
try {
subscriber.onError(t);
} catch (OnCompletedFailedException
| OnErrorFailedException
| OnErrorNotImplementedException e) {
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
CompositeException composite = new CompositeException(t, inner);
RxJavaPlugins.getInstance().getErrorHandler().handleError(composite);
}
}
}
示例2: onError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Override public void onError(Throwable throwable) {
try {
subscriber.onNext(Result.<R>error(throwable));
} catch (Throwable t) {
try {
subscriber.onError(t);
} catch (OnCompletedFailedException
| OnErrorFailedException
| OnErrorNotImplementedException e) {
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
CompositeException composite = new CompositeException(t, inner);
RxJavaPlugins.getInstance().getErrorHandler().handleError(composite);
}
return;
}
subscriber.onCompleted();
}
示例3: onError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Override
public void onError(Throwable throwable) {
try {
subscriber.onNext(Result.<R>error(throwable));
} catch (Throwable t) {
try {
subscriber.onError(t);
} catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) {
RxJavaHooks.getOnError().call(e);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
RxJavaHooks.getOnError().call(new CompositeException(t, inner));
}
return;
}
subscriber.onCompleted();
}
示例4: call
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Override
public final void call(Subscriber<? super T> subscriber) {
try {
T data = execute();
if (!subscriber.isUnsubscribed()) {
subscriber.onNext(data);
}
} catch (Throwable e) {
ViseLog.e(e);
Exceptions.throwIfFatal(e);
if (!subscriber.isUnsubscribed()) {
subscriber.onError(e);
}
return;
}
if (!subscriber.isUnsubscribed()) {
subscriber.onCompleted();
}
}
示例5: emitError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
void emitError(Throwable t) {
set(STATE_TERMINATED);
if (!isUnsubscribed()) {
try {
subscriber.onError(t);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
CompositeException composite = new CompositeException(t, inner);
RxJavaPlugins.getInstance().getErrorHandler().handleError(composite);
}
}
}
示例6: onError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Override public void onError(Throwable throwable) {
try {
subscriber.onNext(Result.<R>error(throwable));
} catch (Throwable t) {
try {
subscriber.onError(t);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
CompositeException composite = new CompositeException(t, inner);
RxJavaPlugins.getInstance().getErrorHandler().handleError(composite);
}
return;
}
subscriber.onCompleted();
}
示例7: handleOnNextValueRendering
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
@Beta
public final String handleOnNextValueRendering(Object item) {
try {
return render(item);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return item.getClass().getName() + ERROR_IN_RENDERING_SUFFIX;
} catch (Throwable t) {
Exceptions.throwIfFatal(t);
return item.getClass().getName() + ERROR_IN_RENDERING_SUFFIX;
}
}
示例8: emitComplete
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
void emitComplete() {
set(STATE_TERMINATED);
try {
if (!isUnsubscribed()) {
subscriber.onCompleted();
}
} catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) {
RxJavaHooks.getOnError().call(e);
} catch (Throwable t) {
Exceptions.throwIfFatal(t);
RxJavaHooks.getOnError().call(t);
}
}
示例9: emitError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
void emitError(Throwable t) {
set(STATE_TERMINATED);
if (!isUnsubscribed()) {
try {
subscriber.onError(t);
} catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) {
RxJavaHooks.getOnError().call(e);
} catch (Throwable inner) {
Exceptions.throwIfFatal(inner);
RxJavaHooks.getOnError().call(new CompositeException(t, inner));
}
}
}
示例10: onError
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
public void onError(Throwable e) {
Exceptions.throwIfFatal(e);
if (!this.done) {
this.done = true;
_onError(e);
}
}
示例11: subscribe
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
public final void subscribe(CompletableSubscriber s) {
requireNonNull(s);
try {
this.onSubscribe.call(s);
} catch (NullPointerException ex) {
throw ex;
} catch (Throwable ex2) {
ERROR_HANDLER.handleError(ex2);
Exceptions.throwIfFatal(ex2);
NullPointerException toNpe = toNpe(ex2);
}
}
示例12: onNext
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
public void onNext(T args) {
try {
if (!this.done) {
this.actual.onNext(args);
}
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
onError(e);
}
}
示例13: unsafeSubscribe
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
public final Subscription unsafeSubscribe(Subscriber<? super T> subscriber) {
try {
subscriber.onStart();
hook.onSubscribeStart(this, this.onSubscribe).call(subscriber);
return hook.onSubscribeReturn(subscriber);
} catch (Throwable e2) {
Exceptions.throwIfFatal(e2);
hook.onSubscribeError(new RuntimeException("Error occurred attempting to subscribe [" + e.getMessage() + "] and then again while trying to pass to onError.", e2));
}
}
示例14: call
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
public Subscriber<? super T> call(final Subscriber<? super T> child) {
Subscriber<T> s = new Subscriber<T>() {
private boolean done = false;
public void onNext(T t) {
if (!this.done) {
child.onNext(t);
}
}
public void onError(Throwable e) {
if (this.done) {
Exceptions.throwIfFatal(e);
return;
}
this.done = true;
RxJavaPlugins.getInstance().getErrorHandler().handleError(e);
unsubscribe();
OperatorOnErrorResumeNextViaObservable.this.resumeSequence.unsafeSubscribe(child);
}
public void onCompleted() {
if (!this.done) {
this.done = true;
child.onCompleted();
}
}
public void setProducer(final Producer producer) {
child.setProducer(new Producer() {
public void request(long n) {
producer.request(n);
}
});
}
};
child.add(s);
return s;
}
示例15: emitLoop
import rx.exceptions.Exceptions; //導入方法依賴的package包/類
void emitLoop() {
Subscriber<? super R> child = this.child;
Queue<Object> queue = this.queue;
NotificationLite<R> nl = NotificationLite.instance();
AtomicLong requested = this.requested;
long r = requested.get();
while (true) {
boolean max = r == Long.MAX_VALUE;
if (!checkTerminated(this.done, queue.isEmpty(), child)) {
long e = 0;
while (r != 0) {
boolean d = this.done;
Object o = queue.poll();
boolean empty = o == null;
if (!checkTerminated(d, empty, child)) {
if (empty) {
break;
}
R v = nl.getValue(o);
try {
child.onNext(v);
r--;
e--;
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
child.onError(OnErrorThrowable.addValueAsLastCause(ex, v));
return;
}
}
return;
}
if (!(e == 0 || max)) {
r = requested.addAndGet(e);
}
synchronized (this) {
if (this.missed) {
this.missed = false;
} else {
this.emitting = false;
return;
}
}
}
return;
}
}