Anything can happen during the processing of the query, anything from a IOException to a protobuf specific exception, or a JPA query validation exception or even a Lucene related exception and many many others. So I can only be vague here regarding the declared exception. The point is I need to signal the failure somehow to the calling HR server which should wrap this exception in any way it sees fit so it can pass it over the wire to the HR client. Not declaring a checked exception would force me to wrap it in a RuntimeException, which only obscures the problem even more.

It's probably very un-standard to declare thrown exceptions in Scala, but this is only needed because the implementor is java in this case. I'm not an expert on the scala-java interop so better solutions are welcome.