Handle errors via AsyncListener
This is a limited backport of commit #e0678b mainly providing the fix without exposing the onError callbacks. Issue: SPR-16058
This commit is contained in:
@@ -166,11 +166,9 @@ public class ResponseBodyEmitter {
|
||||
this.handler.send(object, mediaType);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
completeWithError(ex);
|
||||
throw ex;
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
completeWithError(ex);
|
||||
throw new IllegalStateException("Failed to send " + object, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ public class ResponseBodyEmitterTests {
|
||||
// expected
|
||||
}
|
||||
verify(this.handler).send("foo", MediaType.TEXT_PLAIN);
|
||||
verify(this.handler).completeWithError(failure);
|
||||
verifyNoMoreInteractions(this.handler);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user