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

investigate how stack traces can be improved #2

Open
rkuhn opened this issue Sep 6, 2014 · 0 comments
Open

investigate how stack traces can be improved #2

rkuhn opened this issue Sep 6, 2014 · 0 comments

Comments

@rkuhn
Copy link
Owner

rkuhn commented Sep 6, 2014

Consider the following test case:

  private def flop = async { assert(false, "this is FALSE") } // <--- SomeTests.scala:14

  @Test def two = async {
    val x = await(op)
    val y = await(flop).toString
    val z = await(op)
    val w = x + z
    y + w
  }

Currently the stack trace reported looks like this:

java.lang.AssertionError: assertion failed: this is FALSE
    at scala.Predef$.assert(Predef.scala:165)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply$mcV$sp(SomeTests.scala:14)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply(SomeTests.scala:14)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply(SomeTests.scala:14)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

It would be nicer if we could somehow wrap the exception at the line which contains await(flop), giving the user a better clue what went wrong.

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

No branches or pull requests

1 participant