Sorry I may not have made which ConnectionException I was expecting clear. 
I was talking about the ConnectionException in Akka streams which extends 
StreamTcpException. It is defined in 
https://github.com/akka/akka/blob/release-2.3-dev/akka-stream/src/main/scala/akka/stream/StreamTcpException.scala
.

Looking at the name I was expecting that ConnectionException to be the 
error in the stream for connection failures and StreamTcpException for 
errors once the connection has been established (e.g. the remote server 
aborting the connection before sending the response). It would be nicer for 
my application if it behaved like this, however if there are no planned 
changes to this then the current implementation will work.

On Friday, April 10, 2015 at 3:27:30 PM UTC+1, Akka Team wrote:
>
>
>
> On Fri, Apr 10, 2015 at 3:35 PM, Stephen Penney <stephen.pen...@gmail.com 
> <javascript:>> wrote:
>
>> I am working on application that makes a request to a downstream service 
>> and want to identify if these fail due to a connection failure.
>>
>> Currently using streams 1.0-M4, obtaining the connection with 
>> Http().outgoingConnection(address, port). When using the returned flow for 
>> a HttpRequest that should fail to connect it fails with a 
>> StreamTcpException("Connection failed."). Is this intentionally avoiding 
>> using the ConnectionException class and if so why is this beneficial? 
>>
>
> We tend to wrap lower level exceptions into higher level ones. It would be 
> nice if we could just provide semantic subclasses of that exception, but 
> since the original ConnectionException does not give any other information 
> than a localized, OS specific text, this probably won't happen.
>  
>
>> I want to avoid relying on the message text if possible.
>>
>
> But how is that different from ConnectionException? It is localized even. 
> In one of our tests we need to first provoke an aborted exception 
> ("Connection reset by peer"), save it, and then use it in the assertions in 
> the real tests (since the message might be "A távoli állomás 
> kényszerítetten bezárta a kapcsolatot" or "拒绝连接" depending on our OS and 
> locale). 
>
> -Endre
>  
>
>>
>> I can't find any documentation in 1.0-M4 or 1.0-M5 for when the 
>> exceptions are thrown (looking at the ConnectionException is currently only 
>> thrown by the TcpListenStreamActor), so I want to check that I'm doing the 
>> right thing to identify these failures.
>>
>> Thanks,
>> Stephen
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - Reactive apps on the JVM
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to