-
Notifications
You must be signed in to change notification settings - Fork 9
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
BasicCompletes Must Handle Latent Registration of recoverFrom(Exception) #12
Comments
@Framstag Should be fixed. Please test and confirm. |
Updates to current master via bintray... Modified example as follows: private fun getUser(id: String): Completes<Response> {
val userId = UserId.from(id)
logger.info("Loading user $userId...")
return stage.maybeActorOf(IUser::class.java,addressFactory.from(userId.toString()))
.andThen {
maybeUser ->
logger.info("Return Response.Status.Ok")
if (maybeUser.isEmpty) {
throw Exception("Not found")
}
Response.of(Response.Status.Ok, serialized(maybeUser.orElse(null)))
}
.recoverFrom {
e ->
logger.error("Error:",e)
logger.warn("Return Response.Status.NotFound: " + e.message)
Response.of(Response.Status.NotFound) // Response
}
} Exception is caught and printed as expected. Analysed code in debugger. Exception is stored during andThen() and later on handled during recoverFrom() call. Rest call though does not return (curl is hanging). |
VaughnVernon
changed the title
BasicCompletes Must Handle Latent Registration of receiverFrom(Exception)
BasicCompletes Must Handle Latent Registration of recoverFrom(Exception)
Nov 1, 2019
This was referenced May 23, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When there is an exception thrown prior to the
receiverFrom(Exception)
being registered onBasicCompletes<T>
the outcome should be delayed until the registration is completed. If there is never a registration ofreceiverFrom(Exception)
then the outcome will be unknown.The text was updated successfully, but these errors were encountered: