Skip to content

Commit

Permalink
fix #1078 - do not throw dropped errors and callback hook
Browse files Browse the repository at this point in the history
add missing onNextDropped hook in Mono.create
  • Loading branch information
Stephane Maldini committed Feb 19, 2018
1 parent db1126a commit db1ec5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 Pivotal Software Inc, All Rights Reserved.
* Copyright (c) 2011-2018 Pivotal Software Inc, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -166,15 +166,15 @@ public FluxSink<T> next(T t) {
public void error(Throwable t) {
Objects.requireNonNull(t, "t is null in sink.error(t)");
if (sink.isCancelled() || done) {
Operators.onErrorDropped(t, sink.currentContext());
Operators.onOperatorError(t, sink.currentContext());
return;
}
if (Exceptions.addThrowable(ERROR, this, t)) {
done = true;
drain();
}
else {
Operators.onErrorDropped(t, sink.currentContext());
Operators.onOperatorError(t, sink.currentContext());
}
}

Expand Down Expand Up @@ -411,7 +411,7 @@ public void complete() {
@Override
public void error(Throwable e) {
if (isCancelled()) {
Operators.onErrorDropped(e, actual.currentContext());
Operators.onOperatorError(e, actual.currentContext());
return;
}
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 Pivotal Software Inc, All Rights Reserved.
* Copyright (c) 2011-2018 Pivotal Software Inc, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,6 +131,7 @@ public void success(@Nullable T value) {
for (; ; ) {
int s = state;
if (s == HAS_REQUEST_HAS_VALUE || s == NO_REQUEST_HAS_VALUE) {
Operators.onNextDropped(value, actual.currentContext());
return;
}
if (s == HAS_REQUEST_NO_VALUE) {
Expand Down Expand Up @@ -163,7 +164,7 @@ public void error(Throwable e) {
}
}
else {
Operators.onErrorDropped(e, actual.currentContext());
Operators.onOperatorError(e, actual.currentContext());
}
}

Expand Down

0 comments on commit db1ec5c

Please sign in to comment.