jboner/akka — comment on commit e19dc55481f7f7fde38a207d0954a5b4573ee51f
File: akka-camel/src/main/scala/akka/camel/DangerousStuff.scala line 0
By piotrga:

It's not about cool, it's about readability, and using abstractions.
I can stand doing:
try x finally y

but:
try {
template.start()
} catch {
case e=> {
try {
context.stop()
} catch {
case e=> // swallow, so the offending exception is thrown
}
throw e
}
}
Is beyond my threshold and it is not a good practice. It is mixing the levels of abstractions in a method.

We need abstractions for this things the same way that we need abstractions for concurrency like actors instead of threads.
We could do things with threads, queues etc. but we choose to use actors instead. How is it different for error handling?

BTW. connect-otherwise block I actually took from akka examples, so it is the same principle as already used within akka.