Await throws Exception instead of TimeoutException

46 views
Skip to first unread message

Antony Stubbs

unread,
May 26, 2012, 8:12:42 PM5/26/12
to akka...@googlegroups.com
Await#result javadoc explains it throws TimeoutException, except the actual declaration is Exception. The methods it calls do seem to throw Exception though. Can this be fixed?

  @throws(classOf[Exception])
  def result[T](awaitable: Awaitable[T], atMost: Duration): T = awaitable.result(atMost)

√iktor Ҡlang

unread,
May 27, 2012, 6:31:35 AM5/27/12
to akka...@googlegroups.com
On Sun, May 27, 2012 at 2:12 AM, Antony Stubbs <antony...@gmail.com> wrote:
Await#result javadoc explains it throws TimeoutException, except the actual declaration is Exception. The methods it calls do seem to throw Exception though. Can this be fixed?


  @throws(classOf[Exception])
  def result[T](awaitable: Awaitable[T], atMost: Duration): T = awaitable.result(atMost)

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/IZvQ4nLsSBEJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Jonas Bonér

unread,
May 27, 2012, 4:12:28 PM5/27/12
to akka...@googlegroups.com
He is referring to this ScalaDoc doc on Await object:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L70
Does not match signature:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L73

Why @throws(classOf[Exception])
and not @throws(classOf[TimeoutException])

When the ScalaDoc clearly says it throws TimeoutException.

/Jonas
Jonas Bonér
CTO
Typesafe - The software stack for applications that scale
Phone: +46 733 777 123
Twitter: @jboner

√iktor Ҡlang

unread,
May 27, 2012, 4:14:38 PM5/27/12
to akka...@googlegroups.com
On Sun, May 27, 2012 at 10:12 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
He is referring to this ScalaDoc doc on Await object:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L70
Does not match signature:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L73

Why @throws(classOf[Exception])
and not @throws(classOf[TimeoutException])

When the ScalaDoc clearly says it throws TimeoutException.

Thanks for the interpretation, I'll fix. :-)

√iktor Ҡlang

unread,
May 27, 2012, 4:16:24 PM5/27/12
to akka...@googlegroups.com
On Sun, May 27, 2012 at 10:14 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:


On Sun, May 27, 2012 at 10:12 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
He is referring to this ScalaDoc doc on Await object:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L70
Does not match signature:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L73

Why @throws(classOf[Exception])
and not @throws(classOf[TimeoutException])

When the ScalaDoc clearly says it throws TimeoutException.

Thanks for the interpretation, I'll fix. :-)

It should be clear though that the ScalaDoc is right, it does indeed throw that exception when there's a timeout.
I'll add a second line explaining the other exceptions.

Jonas Boner

unread,
May 27, 2012, 4:17:55 PM5/27/12
to akka...@googlegroups.com
On Sun, May 27, 2012 at 10:14 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:
>
>
> On Sun, May 27, 2012 at 10:12 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
>>
>> He is referring to this ScalaDoc doc on Await object:
>>
>> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L70
>> Does not match signature:
>>
>> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Future.scala#L73
>>
>> Why @throws(classOf[Exception])
>> and not @throws(classOf[TimeoutException])
>>
>> When the ScalaDoc clearly says it throws TimeoutException.
>
>
> Thanks for the interpretation, I'll fix. :-)

No worries. :-)
Thanks.
Reply all
Reply to author
Forward
0 new messages