Skip to content
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

AsyncStack serious issue #143

Closed
lunayo opened this issue Jul 11, 2015 · 1 comment
Closed

AsyncStack serious issue #143

lunayo opened this issue Jul 11, 2015 · 1 comment

Comments

@lunayo
Copy link

lunayo commented Jul 11, 2015

It turns out that if there are two similar variables (especially, with the same name) which return future[result] to the stack, one of the variable will return Exception without any detail messages.
Detail on how to reproduce:

def functionA = AsyncStack(AuthorityKey -> UserRole.NormalUser) { implicit request =>
      val someVariable: Future[Result] = collection.find() 
      someVariable.map { variable =>
         ...
      }
}

def functionB = AsyncStack(AuthorityKey -> UserRole.NormalUser) { implicit request =>
      val someVariable: Future[Result] = collection.find()
       // someVariable return Java exception immediately
      someVariable.map { variable< =>
         ...
      }
}
@gakuzzzz
Copy link
Member

This is standard behavior of Play2 ActionBuilder.

It reproduce as follows

def foo = Action.async { implicit request =>
  throw new Exception("fooo")
}

You can report the failure by http:https://www.scala-lang.org/api/2.11.7/index.html#scala.concurrent.ExecutionContext@reportFailure%28cause:Throwable%29:Unit
or play2 error handling system https://www.playframework.com/documentation/2.4.2/ScalaErrorHandling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants