New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promise
returned from AsyncHttpClient
request doesn't handle exceptions thrown in then
function
#260
Comments
I have made a minimal test
|
Hi, @Qudratillo ActiveJ has a fatal error handler facility called FatallErrorHandler. When a fatal error occurs inside a promise, the configured fatal error handler for a current thread handles it. In your last example, you use promises with no Eventloop. So, to change a fatal error handler you can add FatalErrorHandlers.setThreadFatalErrorHandler(FatalErrorHandler.ignore()); at the start of a test. There are plenty of error handlers you can find in the As for your initial issue, you use promises in the context of |
Hi @eduard-vasinskyi,
Usage is
|
It is solved using
|
Above function (in Kotlin) expected to return
HttpResponse.ofCode(400)
but its promise is never completing since exception thrown inmap
block is not deligated to promise.After putting try-catch block into
then
block I found that exception thrown in map is not thrown insidemap
block but it is thrown insidethen
block.Stack trace
I expect any
then
andmap
functions of anyPromise
implementation must delegate exception thrown inside their map blocks to the promise itself. I am not sure if I can produce it in Java though.The text was updated successfully, but these errors were encountered: